Skip to content

Commit d5768c5

Browse files
authored
Merge pull request #46 from adafruit/main
Update from adafruit main
2 parents 03d3e1f + 2a78a51 commit d5768c5

File tree

211 files changed

+6625
-4993
lines changed

Some content is hidden

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

211 files changed

+6625
-4993
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 2 deletions
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

Lines changed: 27 additions & 23 deletions
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
@@ -178,6 +178,7 @@ jobs:
178178
- "TG-Watch"
179179
- "adafruit_feather_rp2040"
180180
- "adafruit_itsybitsy_rp2040"
181+
- "adafruit_qtpy_rp2040"
181182
- "aloriumtech_evo_m51"
182183
- "aramcon_badge_2019"
183184
- "arduino_mkr1300"
@@ -189,6 +190,7 @@ jobs:
189190
- "bastble"
190191
- "bdmicro_vina_d21"
191192
- "bdmicro_vina_d51"
193+
- "bdmicro_vina_d51_pcb7"
192194
- "bless_dev_board_multi_sensor"
193195
- "blm_badge"
194196
- "capablerobot_usbhub"
@@ -238,6 +240,7 @@ jobs:
238240
- "hallowing_m0_express"
239241
- "hallowing_m4_express"
240242
- "hiibot_bluefi"
243+
- "huntercat_nfc"
241244
- "ikigaisense_vita"
242245
- "imxrt1010_evk"
243246
- "imxrt1020_evk"
@@ -299,7 +302,6 @@ jobs:
299302
- "pyruler"
300303
- "qtpy_m0"
301304
- "qtpy_m0_haxpress"
302-
- "qtpy_rp2040"
303305
- "raspberry_pi_pico"
304306
- "raytac_mdbt50q-db-40"
305307
- "robohatmm1_m4"
@@ -308,6 +310,7 @@ jobs:
308310
- "same54_xplained"
309311
- "seeeduino_wio_terminal"
310312
- "seeeduino_xiao"
313+
- "sensebox_mcu"
311314
- "serpente"
312315
- "shirtty"
313316
- "silicognition-m4-shim"
@@ -355,22 +358,22 @@ jobs:
355358
uses: actions/setup-python@v1
356359
with:
357360
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/*
358366
- name: Install deps
359367
run: |
360368
sudo apt-get install -y gettext
361-
pip install requests sh click setuptools awscli
369+
pip install -r requirements-dev.txt
362370
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
363371
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
364372
- name: Versions
365373
run: |
366374
gcc --version
367375
arm-none-eabi-gcc --version
368376
python3 --version
369-
- uses: actions/[email protected]
370-
with:
371-
submodules: true
372-
fetch-depth: 0
373-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
374377
- name: mpy-cross
375378
run: make -C mpy-cross -j2
376379
- name: build
@@ -404,6 +407,11 @@ jobs:
404407
uses: actions/setup-python@v1
405408
with:
406409
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/*
407415
- name: Install deps
408416
run: |
409417
sudo apt-get install -y gettext
@@ -415,11 +423,6 @@ jobs:
415423
gcc --version
416424
riscv64-unknown-elf-gcc --version
417425
python3 --version
418-
- uses: actions/[email protected]
419-
with:
420-
submodules: true
421-
fetch-depth: 0
422-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
423426
- name: mpy-cross
424427
run: make -C mpy-cross -j2
425428
- name: build
@@ -450,6 +453,7 @@ jobs:
450453
- "adafruit_funhouse"
451454
- "adafruit_magtag_2.9_grayscale"
452455
- "adafruit_metro_esp32s2"
456+
- "artisense_rd00"
453457
- "electroniccats_bastwifi"
454458
- "espressif_kaluga_1"
455459
- "espressif_saola_1_wroom"
@@ -500,7 +504,7 @@ jobs:
500504
- name: Install CircuitPython deps
501505
run: |
502506
source $IDF_PATH/export.sh
503-
pip install requests sh click setuptools awscli
507+
pip install -r requirements-dev.txt
504508
sudo apt-get install -y gettext ninja-build
505509
env:
506510
IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf

.github/workflows/create_website_pr.yml

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

.gitmodules

Lines changed: 5 additions & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/shared_bindings_matrix.py

Lines changed: 58 additions & 7 deletions
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

Lines changed: 12 additions & 0 deletions
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)