Skip to content

Commit 9253351

Browse files
authored
Merge branch 'main' into main
2 parents 999ee68 + 55c8075 commit 9253351

File tree

611 files changed

+14718
-3311
lines changed

Some content is hidden

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

611 files changed

+14718
-3311
lines changed

.github/workflows/build.yml

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
test:
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-20.04
1818
steps:
1919
- name: Dump GitHub context
2020
env:
@@ -35,13 +35,40 @@ jobs:
3535
python-version: 3.8
3636
- name: Install deps
3737
run: |
38+
sudo apt-get update
3839
sudo apt-get install -y eatmydata
3940
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
40-
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli
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
4142
- name: Versions
4243
run: |
4344
gcc --version
4445
python3 --version
46+
- name: Translations
47+
run: make check-translate
48+
- name: New boards check
49+
run: python3 -u ci_new_boards_check.py
50+
working-directory: tools
51+
- name: Duplicate USB VID/PID Check
52+
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
53+
- name: Build and Validate Stubs
54+
run: make check-stubs -j2
55+
- uses: actions/upload-artifact@v2
56+
with:
57+
name: stubs
58+
path: circuitpython-stubs*
59+
- name: Test Documentation Build (HTML)
60+
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
61+
- uses: actions/upload-artifact@v2
62+
with:
63+
name: docs
64+
path: _build/html
65+
- name: Test Documentation Build (LaTeX/PDF)
66+
run: |
67+
make latexpdf
68+
- uses: actions/upload-artifact@v2
69+
with:
70+
name: docs
71+
path: _build/latex
4572
- name: Build mpy-cross
4673
run: make -C mpy-cross -j2
4774
- name: Build unix port
@@ -67,32 +94,6 @@ jobs:
6794
- name: mpy Tests
6895
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
6996
working-directory: tests
70-
- name: Stubs
71-
run: make stubs -j2
72-
- uses: actions/upload-artifact@v2
73-
with:
74-
name: stubs
75-
path: circuitpython-stubs*
76-
- name: Test Documentation Build (HTML)
77-
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
78-
- uses: actions/upload-artifact@v2
79-
with:
80-
name: docs
81-
path: _build/html
82-
- name: Test Documentation Build (LaTeX/PDF)
83-
run: |
84-
make latexpdf
85-
- uses: actions/upload-artifact@v2
86-
with:
87-
name: docs
88-
path: _build/latex
89-
- name: Translations
90-
run: make check-translate
91-
- name: New boards check
92-
run: python3 -u ci_new_boards_check.py
93-
working-directory: tools
94-
- name: Duplicate USB VID/PID Check
95-
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
9697
- name: Build mpy-cross.static-raspbian
9798
run: make -C mpy-cross -j2 -f Makefile.static-raspbian
9899
- uses: actions/upload-artifact@v2
@@ -119,6 +120,7 @@ jobs:
119120
zip -9r circuitpython-stubs.zip circuitpython-stubs
120121
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1
121122
env:
123+
AWS_PAGER: ''
122124
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
123125
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
124126
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
@@ -159,13 +161,14 @@ jobs:
159161
run: |
160162
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1
161163
env:
164+
AWS_PAGER: ''
162165
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
163166
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
164167
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
165168

166169

167170
build-arm:
168-
runs-on: ubuntu-18.04
171+
runs-on: ubuntu-20.04
169172
needs: test
170173
strategy:
171174
fail-fast: false
@@ -182,6 +185,7 @@ jobs:
182185
- "arduino_nano_33_iot"
183186
- "arduino_zero"
184187
- "bast_pro_mini_m0"
188+
- "bastble"
185189
- "bdmicro_vina_d21"
186190
- "bdmicro_vina_d51"
187191
- "bless_dev_board_multi_sensor"
@@ -196,6 +200,8 @@ jobs:
196200
- "circuitplayground_express_displayio"
197201
- "clue_nrf52840_express"
198202
- "cp32-m4"
203+
- "cp_sapling_m0"
204+
- "cp_sapling_m0_spiflash"
199205
- "datalore_ip_m4"
200206
- "datum_distance"
201207
- "datum_imu"
@@ -306,6 +312,7 @@ jobs:
306312
- "sparkfun_samd21_mini"
307313
- "sparkfun_samd51_thing_plus"
308314
- "spresense"
315+
- "stackrduino_m0_pro"
309316
- "stm32f411ce_blackpill"
310317
- "stm32f411ve_discovery"
311318
- "stm32f412zg_discovery"
@@ -315,7 +322,8 @@ jobs:
315322
- "teensy40"
316323
- "teensy41"
317324
- "teknikio_bluebird"
318-
- "thunderpack"
325+
- "thunderpack_v11"
326+
- "thunderpack_v12"
319327
- "tinkeringtech_scoutmakes_azul"
320328
- "trellis_m4_express"
321329
- "trinket_m0"
@@ -337,8 +345,8 @@ jobs:
337345
run: |
338346
sudo apt-get install -y gettext
339347
pip install requests sh click setuptools awscli
340-
wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
341-
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
348+
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
349+
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
342350
- name: Versions
343351
run: |
344352
gcc --version
@@ -363,12 +371,13 @@ jobs:
363371
- name: Upload to S3
364372
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
365373
env:
374+
AWS_PAGER: ''
366375
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
367376
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
368377
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
369378

370379
build-riscv:
371-
runs-on: ubuntu-18.04
380+
runs-on: ubuntu-20.04
372381
needs: test
373382
strategy:
374383
fail-fast: false
@@ -411,18 +420,19 @@ jobs:
411420
- name: Upload to S3
412421
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
413422
env:
423+
AWS_PAGER: ''
414424
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
415425
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
416426
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
417427
build-xtensa:
418-
runs-on: ubuntu-latest
428+
runs-on: ubuntu-20.04
419429
needs: test
420430
strategy:
421431
fail-fast: false
422432
matrix:
423433
board:
424-
- "adafruit_esp32s2_eink_portal"
425434
- "adafruit_feather_esp32s2_nopsram"
435+
- "adafruit_magtag_2.9_grayscale"
426436
- "adafruit_metro_esp32s2"
427437
- "electroniccats_bastwifi"
428438
- "espressif_kaluga_1"
@@ -506,6 +516,7 @@ jobs:
506516
- name: Upload to S3
507517
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
508518
env:
519+
AWS_PAGER: ''
509520
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
510521
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
511522
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))

.github/workflows/create_website_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
website:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-20.04
1414
steps:
1515
- name: Dump GitHub context
1616
env:

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
pre-commit:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-20.04
1515
steps:
1616
- uses: actions/checkout@v1
1717
- uses: actions/setup-python@v1

.gitmodules

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,7 @@
152152
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git
153153
[submodule "ports/esp32s2/esp-idf"]
154154
path = ports/esp32s2/esp-idf
155-
url = https://github.com/espressif/esp-idf.git
155+
url = https://github.com/adafruit/esp-idf.git
156+
[submodule "ports/esp32s2/certificates/nina-fw"]
157+
path = ports/esp32s2/certificates/nina-fw
158+
url = https://github.com/adafruit/nina-fw.git

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ update-frozen-libraries:
265265
@echo "Updating all frozen libraries to latest tagged version."
266266
cd frozen; for library in *; do cd $$library; ../../tools/git-checkout-latest-tag.sh; cd ..; done
267267

268-
one-of-each: samd21 samd51 esp32s2 litex mimxrt10xx nrf stm
268+
one-of-each: samd21 litex mimxrt10xx nrf stm
269269

270270
samd21:
271271
$(MAKE) -C ports/atmel-samd BOARD=trinket_m0

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ Behavior
114114
finishes or is interrupted. After it is done running, the vm and
115115
hardware is reinitialized. **This means you cannot read state from**
116116
``code.py`` **in the REPL anymore.** CircuitPython's goal for this
117-
change includes reduce confusion about pins and memory being used.
117+
change includes reducing confusion about pins and memory being used.
118118
- After ``code.py`` the REPL can be entered by pressing any key. It no
119119
longer shares state with ``code.py`` so it is a fresh vm.
120120
- Autoreload state will be maintained across reload.
121121
- Adds a safe mode that does not run user code after a hard crash or
122122
brown out. The hope is that this will make it easier to fix code that
123123
causes nasty crashes by making it available through mass storage
124-
after the crash. A reset (the button) is needed after its fixed to
124+
after the crash. A reset (the button) is needed after it's fixed to
125125
get back into normal mode.
126126
- RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes.
127127
- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
"ports/atmel-samd/tools",
173173
"ports/cxd56/mkspk",
174174
"ports/cxd56/spresense-exported-sdk",
175+
"ports/esp32s2/certificates",
175176
"ports/esp32s2/esp-idf",
176177
"ports/esp32s2/peripherals",
177178
"ports/litex/hw",

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

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ STATIC struct {
6161
typedef struct __packed {
6262
uint8_t properties;
6363
uint16_t value_handle;
64-
uint8_t uuid[0]; // 2 or 16 bytes
64+
uint8_t uuid[]; // 2 or 16 bytes
6565
} characteristic_declaration_t;
6666

6767
STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) {
@@ -1010,21 +1010,22 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui
10101010
}
10111011

10121012
int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) {
1013-
struct __packed {
1013+
1014+
typedef struct __packed {
10141015
struct bt_att_hdr h;
10151016
struct bt_att_read_group_req r;
1016-
} req = { {
1017-
.code = BT_ATT_OP_READ_GROUP_REQ,
1018-
}, {
1019-
.start_handle = start_handle,
1020-
.end_handle = end_handle,
1021-
}
1022-
};
1023-
req.r.uuid[0] = uuid & 0xff;
1024-
req.r.uuid[1] = uuid >> 8;
1017+
} req_t;
10251018

1019+
uint8_t req_bytes[sizeof(req_t) + sizeof(uuid)];
1020+
req_t *req = (req_t *) req_bytes;
10261021

1027-
return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer);
1022+
req->h.code = BT_ATT_OP_READ_GROUP_REQ;
1023+
req->r.start_handle = start_handle;
1024+
req->r.end_handle = end_handle;
1025+
req->r.uuid[0] = uuid & 0xff;
1026+
req->r.uuid[1] = uuid >> 8;
1027+
1028+
return send_req_wait_for_rsp(conn_handle, sizeof(req_bytes), req_bytes, response_buffer);
10281029
}
10291030

10301031
STATIC void process_read_group_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
@@ -1305,20 +1306,21 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
13051306
}
13061307

13071308
int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) {
1308-
struct __packed {
1309+
typedef struct __packed {
13091310
struct bt_att_hdr h;
13101311
struct bt_att_read_type_req r;
1311-
} req = { {
1312-
.code = BT_ATT_OP_READ_TYPE_REQ,
1313-
}, {
1314-
.start_handle = start_handle,
1315-
.end_handle = end_handle,
1316-
}
1317-
};
1318-
req.r.uuid[0] = type & 0xff;
1319-
req.r.uuid[1] = type >> 8;
1312+
} req_t;
13201313

1321-
return send_req_wait_for_rsp(conn_handle, sizeof(req), (uint8_t *) &req, response_buffer);
1314+
uint8_t req_bytes[sizeof(req_t) + sizeof(type)];
1315+
req_t *req = (req_t *) req_bytes;
1316+
1317+
req->h.code = BT_ATT_OP_READ_TYPE_REQ;
1318+
req->r.start_handle = start_handle;
1319+
req->r.end_handle = end_handle;
1320+
req->r.uuid[0] = type & 0xff;
1321+
req->r.uuid[1] = type >> 8;
1322+
1323+
return send_req_wait_for_rsp(conn_handle, sizeof(req_bytes), req_bytes, response_buffer);
13221324
}
13231325

13241326
STATIC void process_read_type_rsp(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {

0 commit comments

Comments
 (0)