Skip to content

Commit e8af233

Browse files
authored
Merge branch 'adafruit:main' into waveshare-esp32-s3-tiny
2 parents 42d9b0a + 03e42a8 commit e8af233

File tree

146 files changed

+2120
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+2120
-417
lines changed

.github/workflows/custom-board-build.yml renamed to .github/workflows/build-board-custom.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Custom board build
1+
name: Build board (custom)
22

33
on:
44
workflow_dispatch:
@@ -21,6 +21,11 @@ on:
2121
description: 'Flags: Build flags (e.g. CIRCUITPY_WIFI=1)'
2222
required: false
2323
type: string
24+
branch:
25+
description: 'Branch (only if Version="latest")'
26+
required: false
27+
default: 'main'
28+
type: string
2429
debug:
2530
description: 'Make a debug build'
2631
required: false
@@ -36,7 +41,22 @@ jobs:
3641
- name: Set up repository
3742
run: |
3843
git clone --filter=tree:0 https://github.com/adafruit/circuitpython.git $GITHUB_WORKSPACE
44+
- name: Checkout head / tag
45+
run: |
3946
git checkout ${{ inputs.version == 'latest' && 'HEAD' || inputs.version }}
47+
- name: fork compatibility
48+
if: github.repository_owner != 'adafruit'
49+
run: |
50+
git remote add fork https://github.com/${{github.repository}}.git
51+
git fetch fork --filter=tree:0
52+
- name: branch compatibility
53+
if: inputs.branch != 'main' && inputs.version == 'latest' && github.repository_owner == 'adafruit'
54+
run: |
55+
git checkout ${{inputs.branch}}
56+
- name: branch compatibility (fork)
57+
if: inputs.branch != '' && inputs.version == 'latest' && github.repository_owner != 'adafruit'
58+
run: |
59+
git checkout -b fork-branch fork/${{inputs.branch}}
4060
- name: Set up identifier
4161
if: inputs.debug || inputs.flags != ''
4262
run: |

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install dependencies
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y gettext uncrustify
36+
sudo apt-get install -y gettext
3737
- name: Run pre-commit
3838
uses: pre-commit/[email protected]
3939
- name: Make patch

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
[submodule "ports/espressif/esp-idf"]
144144
path = ports/espressif/esp-idf
145145
url = https://github.com/adafruit/esp-idf.git
146-
branch = circuitpython-v5.1.3
146+
branch = circuitpython-v5.2.2
147147
[submodule "ports/espressif/esp-protocols"]
148148
path = ports/espressif/esp-protocols
149149
url = https://github.com/espressif/esp-protocols.git

devices/ble_hci/common-hal/_bleio/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ bool vm_used_ble;
3737
// }
3838
// }
3939

40+
void common_hal_bleio_init(void) {
41+
}
42+
4043
void bleio_user_reset() {
4144
// HCI doesn't support the BLE workflow so just do a full reset.
4245
bleio_reset();

docs/shared_bindings_matrix.py

Lines changed: 95 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
import pathlib
2727
import re
2828
import subprocess
29-
import sys
30-
import functools
29+
3130

3231
from concurrent.futures import ThreadPoolExecutor
3332

@@ -57,7 +56,8 @@
5756

5857
ALIASES_BRAND_NAMES = {
5958
"circuitplayground_express_4h": "Adafruit Circuit Playground Express 4-H",
60-
"circuitplayground_express_digikey_pycon2019": "Circuit Playground Express Digi-Key PyCon 2019",
59+
"circuitplayground_express_digikey_pycon2019":
60+
"Circuit Playground Express Digi-Key PyCon 2019",
6161
"edgebadge": "Adafruit EdgeBadge",
6262
"pyportal_pynt": "Adafruit PyPortal Pynt",
6363
"gemma_m0_pycon2018": "Adafruit Gemma M0 PyCon 2018",
@@ -87,7 +87,7 @@
8787
"usb": "CIRCUITPY_PYUSB",
8888
}
8989

90-
MODULES_NOT_IN_BINDINGS = [ "binascii", "errno", "json", "re", "ulab" ]
90+
MODULES_NOT_IN_BINDINGS = ["binascii", "errno", "json", "re", "ulab"]
9191

9292
FROZEN_EXCLUDES = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"]
9393
"""Files and dirs at the root of a frozen directory that should be ignored.
@@ -105,7 +105,8 @@ def get_circuitpython_root_dir():
105105

106106

107107
def get_bindings():
108-
"""Get a list of modules in shared-bindings and ports/*/bindings based on folder names."""
108+
"""Get a list of modules in shared-bindings and ports/*/bindings
109+
based on folder names."""
109110
shared_bindings_modules = [
110111
module.name
111112
for module in (get_circuitpython_root_dir() / "shared-bindings").iterdir()
@@ -114,7 +115,8 @@ def get_bindings():
114115
bindings_modules = []
115116
for d in get_circuitpython_root_dir().glob("ports/*/bindings"):
116117
bindings_modules.extend(module.name for module in d.iterdir() if d.is_dir())
117-
return shared_bindings_modules + bindings_modules + MODULES_NOT_IN_BINDINGS + list(ADDITIONAL_MODULES.keys())
118+
return shared_bindings_modules + bindings_modules + MODULES_NOT_IN_BINDINGS + \
119+
list(ADDITIONAL_MODULES.keys())
118120

119121

120122
def get_board_mapping():
@@ -127,7 +129,6 @@ def get_board_mapping():
127129
board_path = root_dir / "ports" / port / "boards"
128130
for board_path in os.scandir(board_path):
129131
if board_path.is_dir():
130-
board_files = os.listdir(board_path.path)
131132
board_id = board_path.name
132133
aliases = ALIASES_BY_BOARD.get(board_path.name, [])
133134
boards[board_id] = {
@@ -181,7 +182,10 @@ def get_settings_from_makefile(port_dir, board_name):
181182
}
182183

183184
contents = subprocess.run(
184-
["make", "-C", port_dir, "-f", "Makefile", f"BOARD={board_name}", "print-CFLAGS", "print-CIRCUITPY_BUILD_EXTENSIONS", "print-FROZEN_MPY_DIRS", "print-SRC_PATTERNS", "print-SRC_SUPERVISOR"],
185+
["make", "-C", port_dir, "-f", "Makefile", f"BOARD={board_name}",
186+
"print-CFLAGS", "print-CIRCUITPY_BUILD_EXTENSIONS",
187+
"print-FROZEN_MPY_DIRS", "print-SRC_PATTERNS",
188+
"print-SRC_SUPERVISOR"],
185189
encoding="utf-8",
186190
errors="replace",
187191
stdout=subprocess.PIPE,
@@ -288,7 +292,6 @@ def lookup_setting(settings, key, default=""):
288292
return value
289293

290294

291-
@functools.cache
292295
def all_ports_all_boards(ports=SUPPORTED_PORTS):
293296
for port in ports:
294297
port_dir = get_circuitpython_root_dir() / "ports" / port
@@ -298,7 +301,9 @@ def all_ports_all_boards(ports=SUPPORTED_PORTS):
298301
yield (port, entry)
299302

300303

301-
def support_matrix_by_board(use_branded_name=True, withurl=True):
304+
def support_matrix_by_board(use_branded_name=True, withurl=True,
305+
add_port=False, add_chips=False,
306+
add_pins=False, add_branded_name=False):
302307
"""Compiles a list of the available core modules available for each
303308
board.
304309
"""
@@ -309,17 +314,64 @@ def support_matrix(arg):
309314
port_dir = get_circuitpython_root_dir() / "ports" / port
310315
settings = get_settings_from_makefile(str(port_dir), entry.name)
311316

312-
if use_branded_name:
317+
if use_branded_name or add_branded_name:
313318
with open(entry / "mpconfigboard.h") as get_name:
314319
board_contents = get_name.read()
315320
board_name_re = re.search(
316321
r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)", board_contents
317322
)
318323
if board_name_re:
319-
board_name = board_name_re.group(1).strip('"')
324+
branded_name = board_name_re.group(1).strip('"')
325+
if '"' in branded_name: # sometimes the closing " is not at line end
326+
branded_name = branded_name[:branded_name.index('"')]
327+
board_name = branded_name
328+
329+
if use_branded_name:
330+
board_name = branded_name
320331
else:
321332
board_name = entry.name
322333

334+
if add_chips:
335+
with open(entry / "mpconfigboard.h") as get_name:
336+
board_contents = get_name.read()
337+
mcu_re = re.search(
338+
r'(?<=MICROPY_HW_MCU_NAME)\s+(.+)', board_contents
339+
)
340+
if mcu_re:
341+
mcu = mcu_re.group(1).strip('"')
342+
if '"' in mcu: # in case the closing " is not at line end
343+
mcu = mcu[:mcu.index('"')]
344+
else:
345+
mcu = ""
346+
with open(entry / "mpconfigboard.mk") as get_name:
347+
board_contents = get_name.read()
348+
flash_re = re.search(
349+
r'(?<=EXTERNAL_FLASH_DEVICES)\s+=\s+(.+)', board_contents
350+
)
351+
if flash_re:
352+
# deal with the variability in the way multiple flash chips
353+
# are denoted. We want them to end up as a quoted,
354+
# comma separated string
355+
flash = flash_re.group(1).replace('"','')
356+
flash = f'"{flash}"'
357+
else:
358+
flash = ""
359+
360+
if add_pins:
361+
pins = []
362+
try:
363+
with open(entry / "pins.c") as get_name:
364+
pin_lines = get_name.readlines()
365+
except FileNotFoundError: # silabs boards have no pins.c
366+
pass
367+
else:
368+
for p in pin_lines:
369+
pin_re = re.search(r"QSTR_([^\)]+).+pin_([^\)]+)", p)
370+
if pin_re:
371+
board_pin = pin_re.group(1)
372+
chip_pin = pin_re.group(2)
373+
pins.append((board_pin, chip_pin))
374+
323375
board_modules = []
324376
for module in base:
325377
key = base[module]["key"]
@@ -344,14 +396,25 @@ def support_matrix(arg):
344396
frozen_modules.sort()
345397

346398
# generate alias boards too
399+
400+
board_info = {
401+
"modules": board_modules,
402+
"frozen_libraries": frozen_modules,
403+
"extensions": board_extensions,
404+
}
405+
if add_branded_name:
406+
board_info["branded_name"] = branded_name
407+
if add_port:
408+
board_info["port"] = port
409+
if add_chips:
410+
board_info["mcu"] = mcu
411+
board_info["flash"] = flash
412+
if add_pins:
413+
board_info["pins"] = pins
347414
board_matrix = [
348415
(
349416
board_name,
350-
{
351-
"modules": board_modules,
352-
"frozen_libraries": frozen_modules,
353-
"extensions": board_extensions,
354-
},
417+
board_info
355418
)
356419
]
357420
if entry.name in ALIASES_BY_BOARD:
@@ -361,14 +424,24 @@ def support_matrix(arg):
361424
alias = ALIASES_BRAND_NAMES[alias]
362425
else:
363426
alias = alias.replace("_", " ").title()
427+
board_info = {
428+
"modules": board_modules,
429+
"frozen_libraries": frozen_modules,
430+
"extensions": board_extensions,
431+
}
432+
if add_branded_name:
433+
board_info["branded_name"] = branded_name
434+
if add_port:
435+
board_info["port"] = port
436+
if add_chips:
437+
board_info["mcu"] = mcu
438+
board_info["flash"] = flash
439+
if add_pins:
440+
board_info["pins"] = pins
364441
board_matrix.append(
365442
(
366443
alias,
367-
{
368-
"modules": board_modules,
369-
"frozen_libraries": frozen_modules,
370-
"extensions": board_extensions,
371-
},
444+
board_info
372445
)
373446
)
374447

locale/ID.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,7 @@ msgstr ""
11811181
msgid "Interrupted by output function"
11821182
msgstr ""
11831183

1184+
#: ports/espressif/common-hal/espulp/ULP.c
11841185
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
11851186
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
11861187
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

locale/circuitpython.pot

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ msgstr ""
113113
#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
114114
#: ports/raspberrypi/common-hal/usb_host/Port.c
115115
#: shared-bindings/digitalio/DigitalInOut.c
116-
#: shared-bindings/microcontroller/Pin.c
116+
#: shared-bindings/microcontroller/Pin.c shared-module/max3421e/Max3421E.c
117117
msgid "%q in use"
118118
msgstr ""
119119

@@ -1114,10 +1114,12 @@ msgstr ""
11141114
msgid "Input/output error"
11151115
msgstr ""
11161116

1117+
#: ports/espressif/common-hal/_bleio/__init__.c
11171118
#: ports/nordic/common-hal/_bleio/__init__.c
11181119
msgid "Insufficient authentication"
11191120
msgstr ""
11201121

1122+
#: ports/espressif/common-hal/_bleio/__init__.c
11211123
#: ports/nordic/common-hal/_bleio/__init__.c
11221124
msgid "Insufficient encryption"
11231125
msgstr ""
@@ -1154,6 +1156,7 @@ msgstr ""
11541156
#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c
11551157
#: ports/atmel-samd/common-hal/countio/Counter.c
11561158
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
1159+
#: ports/atmel-samd/common-hal/max3421e/Max3421E.c
11571160
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
11581161
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
11591162
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
@@ -1173,6 +1176,7 @@ msgstr ""
11731176
msgid "Interrupted by output function"
11741177
msgstr ""
11751178

1179+
#: ports/espressif/common-hal/espulp/ULP.c
11761180
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
11771181
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
11781182
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c
@@ -1284,6 +1288,10 @@ msgstr ""
12841288
msgid "MAC address was invalid"
12851289
msgstr ""
12861290

1291+
#: ports/espressif/common-hal/_bleio/Characteristic.c
1292+
msgid "MITM security not supported"
1293+
msgstr ""
1294+
12871295
#: shared-bindings/is31fl3741/IS31FL3741.c
12881296
msgid "Mapping must be a tuple"
12891297
msgstr ""
@@ -2138,6 +2146,7 @@ msgstr ""
21382146
msgid "Unknown BLE error: %d"
21392147
msgstr ""
21402148

2149+
#: ports/espressif/common-hal/max3421e/Max3421E.c
21412150
#: ports/raspberrypi/common-hal/wifi/__init__.c
21422151
#, c-format
21432152
msgid "Unknown error code %d"
@@ -3809,7 +3818,7 @@ msgstr ""
38093818
msgid "pop from empty %q"
38103819
msgstr ""
38113820

3812-
#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
3821+
#: shared-bindings/socketpool/Socket.c
38133822
msgid "port must be >= 0"
38143823
msgstr ""
38153824

locale/cs.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ msgstr "Chyba přerušení."
11931193
msgid "Interrupted by output function"
11941194
msgstr ""
11951195

1196+
#: ports/espressif/common-hal/espulp/ULP.c
11961197
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
11971198
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
11981199
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

locale/de_DE.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,7 @@ msgstr "Interrupt Fehler."
12041204
msgid "Interrupted by output function"
12051205
msgstr "Unterbrochen durch Ausgabefunktion"
12061206

1207+
#: ports/espressif/common-hal/espulp/ULP.c
12071208
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
12081209
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
12091210
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

locale/el.po

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,7 @@ msgstr ""
11991199
msgid "Interrupted by output function"
12001200
msgstr ""
12011201

1202+
#: ports/espressif/common-hal/espulp/ULP.c
12021203
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
12031204
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
12041205
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

0 commit comments

Comments
 (0)