Skip to content

Commit 7c9f631

Browse files
authored
Merge pull request #7 from adafruit/main
Pull latest changes
2 parents d64d48e + 48de52c commit 7c9f631

File tree

381 files changed

+4209
-1489
lines changed

Some content is hidden

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

381 files changed

+4209
-1489
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4041
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: Build and Validate Stubs
71-
run: make check-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
@@ -184,6 +185,7 @@ jobs:
184185
- "arduino_nano_33_iot"
185186
- "arduino_zero"
186187
- "bast_pro_mini_m0"
188+
- "bastble"
187189
- "bdmicro_vina_d21"
188190
- "bdmicro_vina_d51"
189191
- "bless_dev_board_multi_sensor"
@@ -310,6 +312,7 @@ jobs:
310312
- "sparkfun_samd21_mini"
311313
- "sparkfun_samd51_thing_plus"
312314
- "spresense"
315+
- "stackrduino_m0_pro"
313316
- "stm32f411ce_blackpill"
314317
- "stm32f411ve_discovery"
315318
- "stm32f412zg_discovery"
@@ -342,8 +345,8 @@ jobs:
342345
run: |
343346
sudo apt-get install -y gettext
344347
pip install requests sh click setuptools awscli
345-
wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
346-
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
347350
- name: Versions
348351
run: |
349352
gcc --version

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +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/jepler/esp-idf.git
155+
url = https://github.com/adafruit/esp-idf.git
156156
[submodule "ports/esp32s2/certificates/nina-fw"]
157157
path = ports/esp32s2/certificates/nina-fw
158158
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

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[]) {

devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct bt_att_info_128 {
6969
#define BT_ATT_OP_FIND_INFO_RSP 0x05
7070
struct bt_att_find_info_rsp {
7171
uint8_t format;
72-
uint8_t info[0];
72+
uint8_t info[];
7373
} __packed;
7474

7575
/* Find By Type Value Request */
@@ -78,7 +78,7 @@ struct bt_att_find_type_req {
7878
uint16_t start_handle;
7979
uint16_t end_handle;
8080
uint16_t type;
81-
uint8_t value[0];
81+
uint8_t value[];
8282
} __packed;
8383

8484
struct bt_att_handle_group {
@@ -89,27 +89,28 @@ struct bt_att_handle_group {
8989
/* Find By Type Value Response */
9090
#define BT_ATT_OP_FIND_TYPE_RSP 0x07
9191
struct bt_att_find_type_rsp {
92-
struct bt_att_handle_group list[0];
92+
uint8_t _dummy[0];
93+
struct bt_att_handle_group list[];
9394
} __packed;
9495

9596
/* Read By Type Request */
9697
#define BT_ATT_OP_READ_TYPE_REQ 0x08
9798
struct bt_att_read_type_req {
9899
uint16_t start_handle;
99100
uint16_t end_handle;
100-
uint8_t uuid[0];
101+
uint8_t uuid[];
101102
} __packed;
102103

103104
struct bt_att_data {
104105
uint16_t handle;
105-
uint8_t value[0];
106+
uint8_t value[];
106107
} __packed;
107108

108109
/* Read By Type Response */
109110
#define BT_ATT_OP_READ_TYPE_RSP 0x09
110111
struct bt_att_read_type_rsp {
111112
uint8_t len;
112-
struct bt_att_data data[0];
113+
struct bt_att_data data[];
113114
} __packed;
114115

115116
/* Read Request */
@@ -121,7 +122,8 @@ struct bt_att_read_req {
121122
/* Read Response */
122123
#define BT_ATT_OP_READ_RSP 0x0b
123124
struct bt_att_read_rsp {
124-
uint8_t value[0];
125+
uint8_t _dummy[0];
126+
uint8_t value[];
125127
} __packed;
126128

127129
/* Read Blob Request */
@@ -134,49 +136,52 @@ struct bt_att_read_blob_req {
134136
/* Read Blob Response */
135137
#define BT_ATT_OP_READ_BLOB_RSP 0x0d
136138
struct bt_att_read_blob_rsp {
137-
uint8_t value[0];
139+
uint8_t _dummy[0];
140+
uint8_t value[];
138141
} __packed;
139142

140143
/* Read Multiple Request */
141144
#define BT_ATT_READ_MULT_MIN_LEN_REQ 0x04
142145

143146
#define BT_ATT_OP_READ_MULT_REQ 0x0e
144147
struct bt_att_read_mult_req {
145-
uint16_t handles[0];
148+
uint8_t _dummy[0];
149+
uint16_t handles[];
146150
} __packed;
147151

148152
/* Read Multiple Respose */
149153
#define BT_ATT_OP_READ_MULT_RSP 0x0f
150154
struct bt_att_read_mult_rsp {
151-
uint8_t value[0];
155+
uint8_t _dummy[0];
156+
uint8_t value[];
152157
} __packed;
153158

154159
/* Read by Group Type Request */
155160
#define BT_ATT_OP_READ_GROUP_REQ 0x10
156161
struct bt_att_read_group_req {
157162
uint16_t start_handle;
158163
uint16_t end_handle;
159-
uint8_t uuid[0];
164+
uint8_t uuid[];
160165
} __packed;
161166

162167
struct bt_att_group_data {
163168
uint16_t start_handle;
164169
uint16_t end_handle;
165-
uint8_t value[0];
170+
uint8_t value[];
166171
} __packed;
167172

168173
/* Read by Group Type Response */
169174
#define BT_ATT_OP_READ_GROUP_RSP 0x11
170175
struct bt_att_read_group_rsp {
171176
uint8_t len;
172-
struct bt_att_group_data data[0];
177+
struct bt_att_group_data data[];
173178
} __packed;
174179

175180
/* Write Request */
176181
#define BT_ATT_OP_WRITE_REQ 0x12
177182
struct bt_att_write_req {
178183
uint16_t handle;
179-
uint8_t value[0];
184+
uint8_t value[];
180185
} __packed;
181186

182187
/* Write Response */
@@ -187,15 +192,15 @@ struct bt_att_write_req {
187192
struct bt_att_prepare_write_req {
188193
uint16_t handle;
189194
uint16_t offset;
190-
uint8_t value[0];
195+
uint8_t value[];
191196
} __packed;
192197

193198
/* Prepare Write Respond */
194199
#define BT_ATT_OP_PREPARE_WRITE_RSP 0x17
195200
struct bt_att_prepare_write_rsp {
196201
uint16_t handle;
197202
uint16_t offset;
198-
uint8_t value[0];
203+
uint8_t value[];
199204
} __packed;
200205

201206
/* Execute Write Request */
@@ -214,14 +219,14 @@ struct bt_att_exec_write_req {
214219
#define BT_ATT_OP_NOTIFY 0x1b
215220
struct bt_att_notify {
216221
uint16_t handle;
217-
uint8_t value[0];
222+
uint8_t value[];
218223
} __packed;
219224

220225
/* Handle Value Indication */
221226
#define BT_ATT_OP_INDICATE 0x1d
222227
struct bt_att_indicate {
223228
uint16_t handle;
224-
uint8_t value[0];
229+
uint8_t value[];
225230
} __packed;
226231

227232
/* Handle Value Confirm */
@@ -233,34 +238,35 @@ struct bt_att_signature {
233238

234239
#define BT_ATT_OP_READ_MULT_VL_REQ 0x20
235240
struct bt_att_read_mult_vl_req {
236-
uint16_t handles[0];
241+
uint8_t _dummy[0];
242+
uint16_t handles[];
237243
} __packed;
238244

239245
/* Read Multiple Respose */
240246
#define BT_ATT_OP_READ_MULT_VL_RSP 0x21
241247
struct bt_att_read_mult_vl_rsp {
242248
uint16_t len;
243-
uint8_t value[0];
249+
uint8_t value[];
244250
} __packed;
245251

246252
/* Handle Multiple Value Notification */
247253
#define BT_ATT_OP_NOTIFY_MULT 0x23
248254
struct bt_att_notify_mult {
249255
uint16_t handle;
250256
uint16_t len;
251-
uint8_t value[0];
257+
uint8_t value[];
252258
} __packed;
253259

254260
/* Write Command */
255261
#define BT_ATT_OP_WRITE_CMD 0x52
256262
struct bt_att_write_cmd {
257263
uint16_t handle;
258-
uint8_t value[0];
264+
uint8_t value[];
259265
} __packed;
260266

261267
/* Signed Write Command */
262268
#define BT_ATT_OP_SIGNED_WRITE_CMD 0xd2
263269
struct bt_att_signed_write_cmd {
264270
uint16_t handle;
265-
uint8_t value[0];
271+
uint8_t value[];
266272
} __packed;

0 commit comments

Comments
 (0)