Skip to content

Commit 2a5f3de

Browse files
jeplerUnexpectedMaker
authored andcommitted
Merge pull request #3608 from adafruit/6.0.x
Update main with latest 6.0.x
2 parents caca060 + d0e5499 commit 2a5f3de

File tree

640 files changed

+16326
-3253
lines changed

Some content is hidden

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

640 files changed

+16326
-3253
lines changed

.github/workflows/build.yml

Lines changed: 50 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
@@ -111,12 +112,15 @@ jobs:
111112
with:
112113
name: mpy-cross.static-x64-windows
113114
path: mpy-cross/mpy-cross.static.exe
114-
- name: Upload mpy-cross builds to S3
115+
- name: Upload stubs and mpy-cross builds to S3
115116
run: |
116117
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1
117118
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1
118119
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1
120+
zip -9r circuitpython-stubs.zip circuitpython-stubs
121+
[ -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
119122
env:
123+
AWS_PAGER: ''
120124
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
121125
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
122126
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
@@ -157,19 +161,21 @@ jobs:
157161
run: |
158162
[ -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
159163
env:
164+
AWS_PAGER: ''
160165
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
161166
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
162167
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
163168

164169

165170
build-arm:
166-
runs-on: ubuntu-18.04
171+
runs-on: ubuntu-20.04
167172
needs: test
168173
strategy:
169174
fail-fast: false
170175
matrix:
171176
board:
172177
- "8086_commander"
178+
- "ADM_B_NRF52840_1"
173179
- "TG-Watch02A"
174180
- "aloriumtech_evo_m51"
175181
- "aramcon_badge_2019"
@@ -179,6 +185,7 @@ jobs:
179185
- "arduino_nano_33_iot"
180186
- "arduino_zero"
181187
- "bast_pro_mini_m0"
188+
- "bastble"
182189
- "bdmicro_vina_d21"
183190
- "bdmicro_vina_d51"
184191
- "bless_dev_board_multi_sensor"
@@ -193,6 +200,8 @@ jobs:
193200
- "circuitplayground_express_displayio"
194201
- "clue_nrf52840_express"
195202
- "cp32-m4"
203+
- "cp_sapling_m0"
204+
- "cp_sapling_m0_spiflash"
196205
- "datalore_ip_m4"
197206
- "datum_distance"
198207
- "datum_imu"
@@ -303,6 +312,7 @@ jobs:
303312
- "sparkfun_samd21_mini"
304313
- "sparkfun_samd51_thing_plus"
305314
- "spresense"
315+
- "stackrduino_m0_pro"
306316
- "stm32f411ce_blackpill"
307317
- "stm32f411ve_discovery"
308318
- "stm32f412zg_discovery"
@@ -312,7 +322,8 @@ jobs:
312322
- "teensy40"
313323
- "teensy41"
314324
- "teknikio_bluebird"
315-
- "thunderpack"
325+
- "thunderpack_v11"
326+
- "thunderpack_v12"
316327
- "tinkeringtech_scoutmakes_azul"
317328
- "trellis_m4_express"
318329
- "trinket_m0"
@@ -334,8 +345,8 @@ jobs:
334345
run: |
335346
sudo apt-get install -y gettext
336347
pip install requests sh click setuptools awscli
337-
wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
338-
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
339350
- name: Versions
340351
run: |
341352
gcc --version
@@ -360,12 +371,13 @@ jobs:
360371
- name: Upload to S3
361372
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
362373
env:
374+
AWS_PAGER: ''
363375
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
364376
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
365377
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
366378

367379
build-riscv:
368-
runs-on: ubuntu-18.04
380+
runs-on: ubuntu-20.04
369381
needs: test
370382
strategy:
371383
fail-fast: false
@@ -408,16 +420,18 @@ jobs:
408420
- name: Upload to S3
409421
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
410422
env:
423+
AWS_PAGER: ''
411424
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
412425
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
413426
if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
414427
build-xtensa:
415-
runs-on: ubuntu-latest
428+
runs-on: ubuntu-20.04
416429
needs: test
417430
strategy:
418431
fail-fast: false
419432
matrix:
420433
board:
434+
- "adafruit_magtag_2.9_grayscale"
421435
- "adafruit_metro_esp32s2"
422436
- "electroniccats_bastwifi"
423437
- "espressif_kaluga_1"
@@ -501,6 +515,7 @@ jobs:
501515
- name: Upload to S3
502516
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
503517
env:
518+
AWS_PAGER: ''
504519
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
505520
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
506521
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

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT
66

77
# Contributing
88
Please note that this project is released with a
9-
[Contributor Code of Conduct](https://github.com/adafruit/circuitpython/blob/main/CODE_OF_CONDUCT.md).
9+
[Contributor Code of Conduct](CODE_OF_CONDUCT.md).
1010
By participating in this project you agree to abide by its terms. Participation
1111
covers any forum used to converse about CircuitPython including unofficial and official spaces. Failure to do
1212
so will result in corrective actions such as time out or ban from the project.

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)