Skip to content

Commit cd7f5fe

Browse files
Merge pull request #2 from adafruit/main
From Main
2 parents ac232f2 + ebfe36c commit cd7f5fe

File tree

225 files changed

+7065
-5475
lines changed

Some content is hidden

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

225 files changed

+7065
-5475
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-2
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,3 @@ TimeoutError: Clock stretch too long
5252

5353
<!-- Optionally, add any other information like hardware connection, scope output etc.
5454
If you have already done some debugging, mention it here. -->
55-
56-
Removing [this](url) line resolves the issue.

.github/workflows/build.yml

+30-23
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
sudo apt-get update
3939
sudo apt-get install -y eatmydata
4040
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
41-
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy
41+
pip install -r requirements-dev.txt
4242
- name: Versions
4343
run: |
4444
gcc --version
@@ -132,15 +132,6 @@ jobs:
132132
env:
133133
GITHUB_CONTEXT: ${{ toJson(github) }}
134134
run: echo "$GITHUB_CONTEXT"
135-
- name: Install dependencies
136-
run: |
137-
brew install gettext
138-
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
139-
- name: Versions
140-
run: |
141-
gcc --version
142-
python3 --version
143-
msgfmt --version
144135
- uses: actions/[email protected]
145136
with:
146137
submodules: true
@@ -150,6 +141,15 @@ jobs:
150141
run: |
151142
git describe --dirty --tags
152143
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
144+
- name: Install dependencies
145+
run: |
146+
brew install gettext
147+
echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
148+
- name: Versions
149+
run: |
150+
gcc --version
151+
python3 --version
152+
msgfmt --version
153153
- name: Build mpy-cross
154154
run: make -C mpy-cross -j2
155155
- uses: actions/upload-artifact@v2
@@ -177,6 +177,8 @@ jobs:
177177
- "ADM_B_NRF52840_1"
178178
- "TG-Watch"
179179
- "adafruit_feather_rp2040"
180+
- "adafruit_itsybitsy_rp2040"
181+
- "adafruit_qtpy_rp2040"
180182
- "aloriumtech_evo_m51"
181183
- "aramcon_badge_2019"
182184
- "arduino_mkr1300"
@@ -188,6 +190,7 @@ jobs:
188190
- "bastble"
189191
- "bdmicro_vina_d21"
190192
- "bdmicro_vina_d51"
193+
- "bdmicro_vina_d51_pcb7"
191194
- "bless_dev_board_multi_sensor"
192195
- "blm_badge"
193196
- "capablerobot_usbhub"
@@ -237,6 +240,7 @@ jobs:
237240
- "hallowing_m0_express"
238241
- "hallowing_m4_express"
239242
- "hiibot_bluefi"
243+
- "huntercat_nfc"
240244
- "ikigaisense_vita"
241245
- "imxrt1010_evk"
242246
- "imxrt1020_evk"
@@ -298,14 +302,15 @@ jobs:
298302
- "pyruler"
299303
- "qtpy_m0"
300304
- "qtpy_m0_haxpress"
301-
- "qtpy_rp2040"
302305
- "raspberry_pi_pico"
303306
- "raytac_mdbt50q-db-40"
304307
- "robohatmm1_m4"
308+
- "rotary_trinkey_m0"
305309
- "sam32"
306310
- "same54_xplained"
307311
- "seeeduino_wio_terminal"
308312
- "seeeduino_xiao"
313+
- "sensebox_mcu"
309314
- "serpente"
310315
- "shirtty"
311316
- "silicognition-m4-shim"
@@ -353,22 +358,22 @@ jobs:
353358
uses: actions/setup-python@v1
354359
with:
355360
python-version: 3.8
361+
- uses: actions/[email protected]
362+
with:
363+
submodules: true
364+
fetch-depth: 0
365+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
356366
- name: Install deps
357367
run: |
358368
sudo apt-get install -y gettext
359-
pip install requests sh click setuptools awscli
369+
pip install -r requirements-dev.txt
360370
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
361371
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
362372
- name: Versions
363373
run: |
364374
gcc --version
365375
arm-none-eabi-gcc --version
366376
python3 --version
367-
- uses: actions/[email protected]
368-
with:
369-
submodules: true
370-
fetch-depth: 0
371-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
372377
- name: mpy-cross
373378
run: make -C mpy-cross -j2
374379
- name: build
@@ -402,6 +407,11 @@ jobs:
402407
uses: actions/setup-python@v1
403408
with:
404409
python-version: 3.8
410+
- uses: actions/[email protected]
411+
with:
412+
submodules: true
413+
fetch-depth: 0
414+
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
405415
- name: Install deps
406416
run: |
407417
sudo apt-get install -y gettext
@@ -413,11 +423,6 @@ jobs:
413423
gcc --version
414424
riscv64-unknown-elf-gcc --version
415425
python3 --version
416-
- uses: actions/[email protected]
417-
with:
418-
submodules: true
419-
fetch-depth: 0
420-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
421426
- name: mpy-cross
422427
run: make -C mpy-cross -j2
423428
- name: build
@@ -445,8 +450,10 @@ jobs:
445450
board:
446451
- "adafruit_feather_esp32s2_nopsram"
447452
- "adafruit_feather_esp32s2_tftback_nopsram"
453+
- "adafruit_funhouse"
448454
- "adafruit_magtag_2.9_grayscale"
449455
- "adafruit_metro_esp32s2"
456+
- "artisense_rd00"
450457
- "electroniccats_bastwifi"
451458
- "espressif_kaluga_1"
452459
- "espressif_saola_1_wroom"
@@ -497,7 +504,7 @@ jobs:
497504
- name: Install CircuitPython deps
498505
run: |
499506
source $IDF_PATH/export.sh
500-
pip install requests sh click setuptools awscli
507+
pip install -r requirements-dev.txt
501508
sudo apt-get install -y gettext ninja-build
502509
env:
503510
IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf

.github/workflows/create_website_pr.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ jobs:
1616
env:
1717
GITHUB_CONTEXT: ${{ toJson(github) }}
1818
run: echo "$GITHUB_CONTEXT"
19+
- uses: actions/[email protected]
20+
with:
21+
submodules: true
22+
fetch-depth: 0
1923
- name: Set up Python 3.8
2024
uses: actions/setup-python@v1
2125
with:
2226
python-version: 3.8
2327
- name: Install deps
2428
run: |
25-
pip install requests sh click
29+
pip install -r requirements-dev.txt
2630
- name: Versions
2731
run: |
2832
gcc --version
2933
python3 --version
30-
- uses: actions/[email protected]
31-
with:
32-
submodules: true
33-
fetch-depth: 0
3434
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
3535
- name: CircuitPython version
3636
run: git describe --dirty --tags

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
sudo apt-add-repository -y -u ppa:pybricks/ppa
2020
sudo apt-get install -y black gettext uncrustify
21-
pip3 install polib
21+
pip3 install -r requirements-dev.txt
2222
- name: Populate selected submodules
2323
run: git submodule update --init extmod/ulab
2424
- name: Set PY

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,6 @@ TAGS
8686
####################
8787
.venv
8888
.env
89+
90+
# Uncrustify formatting
91+
*.uncrustify

.gitmodules

+5-1
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,8 @@
173173
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
174174
[submodule "ports/raspberrypi/sdk"]
175175
path = ports/raspberrypi/sdk
176-
url = https://github.com/raspberrypi/pico-sdk.git
176+
url = https://github.com/adafruit/pico-sdk.git
177+
[submodule "data/nvm.toml"]
178+
path = data/nvm.toml
179+
url = https://github.com/adafruit/nvm.toml.git
180+
branch = main

conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
".env",
155155
".venv",
156156
".direnv",
157+
"data",
157158
"docs/autoapi",
158159
"docs/README.md",
159160
"drivers",
@@ -283,7 +284,7 @@
283284
# Add any extra paths that contain custom files (such as robots.txt or
284285
# .htaccess) here, relative to this directory. These files are copied
285286
# directly to the root of the documentation.
286-
html_extra_path = ["docs/robots.txt"]
287+
#html_extra_path = []
287288

288289
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
289290
# using the given strftime format.

data/nvm.toml

Submodule nvm.toml added at 9b4a524

docs/robots.txt

-6
This file was deleted.

docs/shared_bindings_matrix.py

+58-7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,39 @@
3232

3333
SUPPORTED_PORTS = ['atmel-samd', 'cxd56', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'raspberrypi', 'stm']
3434

35+
aliases_by_board = {
36+
"circuitplayground_express": [
37+
"circuitplayground_express_4h",
38+
"circuitplayground_express_digikey_pycon2019",
39+
],
40+
"pybadge": ["edgebadge"],
41+
"pyportal": ["pyportal_pynt"],
42+
"gemma_m0": ["gemma_m0_pycon2018"],
43+
"pewpew10": ["pewpew13"],
44+
}
45+
46+
aliases_brand_names = {
47+
"circuitplayground_express_4h":
48+
"Adafruit Circuit Playground Express 4-H",
49+
"circuitplayground_express_digikey_pycon2019":
50+
"Circuit Playground Express Digi-Key PyCon 2019",
51+
"edgebadge":
52+
"Adafruit EdgeBadge",
53+
"pyportal_pynt":
54+
"Adafruit PyPortal Pynt",
55+
"gemma_m0_pycon2018":
56+
"Adafruit Gemma M0 PyCon 2018",
57+
"pewpew13":
58+
"PewPew 13",
59+
}
60+
61+
additional_modules = {
62+
"fontio": "CIRCUITPY_DISPLAYIO",
63+
"terminalio": "CIRCUITPY_DISPLAYIO",
64+
# "socket": "CIRCUITPY_NETWORK",
65+
"adafruit_bus_device": "CIRCUITPY_BUSDEVICE",
66+
}
67+
3568
def get_circuitpython_root_dir():
3669
""" The path to the root './circuitpython' directory
3770
"""
@@ -71,8 +104,11 @@ def build_module_map():
71104
full_build = False
72105
for module in modules:
73106
full_name = module
74-
search_name = module.lstrip("_")
75-
re_pattern = "CIRCUITPY_{}\s*\??=\s*(.+)".format(search_name.upper())
107+
if module in additional_modules:
108+
search_identifier = additional_modules[module]
109+
else:
110+
search_identifier = 'CIRCUITPY_'+module.lstrip("_").upper()
111+
re_pattern = f"{re.escape(search_identifier)}\s*\??=\s*(.+)"
76112
find_config = re.findall(re_pattern, configs)
77113
if not find_config:
78114
continue
@@ -84,11 +120,12 @@ def build_module_map():
84120
else:
85121
default_val = "None"
86122

87-
base[search_name] = {
123+
base[module] = {
88124
"name": full_name,
89125
"full_build": str(full_build),
90126
"default_value": default_val,
91-
"excluded": {}
127+
"excluded": {},
128+
"key": search_identifier,
92129
}
93130

94131
return base
@@ -164,14 +201,28 @@ def support_matrix(arg):
164201

165202
board_modules = []
166203
for module in base:
167-
key = f'CIRCUITPY_{module.upper()}'
204+
key = base[module]['key']
168205
if int(lookup_setting(settings, key, '0')):
169206
board_modules.append(base[module]['name'])
207+
board_modules.sort()
208+
209+
# generate alias boards too
210+
board_matrix = [(board_name, board_modules)]
211+
if entry.name in aliases_by_board:
212+
for alias in aliases_by_board[entry.name]:
213+
if use_branded_name:
214+
if alias in aliases_brand_names:
215+
alias = aliases_brand_names[alias]
216+
else:
217+
alias = alias.replace("_"," ").title()
218+
board_matrix.append( (alias, board_modules) )
170219

171-
return (board_name, sorted(board_modules))
220+
return board_matrix # this is now a list of (board,modules)
172221

173222
executor = ThreadPoolExecutor(max_workers=os.cpu_count())
174-
boards = dict(sorted(executor.map(support_matrix, all_ports_all_boards())))
223+
mapped_exec = executor.map(support_matrix, all_ports_all_boards())
224+
# flatmap with comprehensions
225+
boards = dict(sorted([board for matrix in mapped_exec for board in matrix]))
175226

176227
#print(json.dumps(boards, indent=2))
177228
return boards

extmod/modure.c

+12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
#include "re1.5/re1.5.h"
2020

21+
#if CIRCUITPY_RE_DEBUG
2122
#define FLAG_DEBUG 0x1000
23+
#endif
2224

2325
typedef struct _mp_obj_re_t {
2426
mp_obj_base_t base;
@@ -401,18 +403,24 @@ STATIC mp_obj_t mod_re_compile(size_t n_args, const mp_obj_t *args) {
401403
}
402404
mp_obj_re_t *o = m_new_obj_var(mp_obj_re_t, char, size);
403405
o->base.type = &re_type;
406+
#if CIRCUITPY_RE_DEBUG
404407
int flags = 0;
405408
if (n_args > 1) {
406409
flags = mp_obj_get_int(args[1]);
407410
}
411+
#else
412+
(void)n_args;
413+
#endif
408414
int error = re1_5_compilecode(&o->re, re_str);
409415
if (error != 0) {
410416
error:
411417
mp_raise_ValueError(translate("Error in regex"));
412418
}
419+
#if CIRCUITPY_RE_DEBUG
413420
if (flags & FLAG_DEBUG) {
414421
re1_5_dumpcode(&o->re);
415422
}
423+
#endif
416424
return MP_OBJ_FROM_PTR(o);
417425
}
418426
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_compile_obj, 1, 2, mod_re_compile);
@@ -456,7 +464,9 @@ STATIC const mp_rom_map_elem_t mp_module_re_globals_table[] = {
456464
#if MICROPY_PY_URE_SUB
457465
{ MP_ROM_QSTR(MP_QSTR_sub), MP_ROM_PTR(&mod_re_sub_obj) },
458466
#endif
467+
#if CIRCUITPY_RE_DEBUG
459468
{ MP_ROM_QSTR(MP_QSTR_DEBUG), MP_ROM_INT(FLAG_DEBUG) },
469+
#endif
460470
};
461471

462472
STATIC MP_DEFINE_CONST_DICT(mp_module_re_globals, mp_module_re_globals_table);
@@ -471,7 +481,9 @@ const mp_obj_module_t mp_module_ure = {
471481

472482
#define re1_5_fatal(x) assert(!x)
473483
#include "re1.5/compilecode.c"
484+
#if CIRCUITPY_RE_DEBUG
474485
#include "re1.5/dumpcode.c"
486+
#endif
475487
#include "re1.5/recursiveloop.c"
476488
#include "re1.5/charclass.c"
477489

0 commit comments

Comments
 (0)