Skip to content

Commit 3401449

Browse files
authored
Merge pull request #47 from adafruit/main
Update from adafruit main
2 parents d5768c5 + fcabbe9 commit 3401449

File tree

732 files changed

+16773
-22507
lines changed

Some content is hidden

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

732 files changed

+16773
-22507
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,13 @@ jobs:
178178
- "TG-Watch"
179179
- "adafruit_feather_rp2040"
180180
- "adafruit_itsybitsy_rp2040"
181+
- "adafruit_neokey_trinkey_m0"
182+
- "adafruit_proxlight_trinkey_m0"
181183
- "adafruit_qtpy_rp2040"
184+
- "adafruit_rotary_trinkey_m0"
185+
- "adafruit_slide_trinkey_m0"
182186
- "aloriumtech_evo_m51"
187+
- "aramcon2_badge"
183188
- "aramcon_badge_2019"
184189
- "arduino_mkr1300"
185190
- "arduino_mkrzero"
@@ -285,6 +290,8 @@ jobs:
285290
- "pewpew_m4"
286291
- "picoplanet"
287292
- "pimoroni_keybow2040"
293+
- "pimoroni_picolipo_16mb"
294+
- "pimoroni_picolipo_4mb"
288295
- "pimoroni_picosystem"
289296
- "pimoroni_tiny2040"
290297
- "pirkey_m0"
@@ -305,7 +312,6 @@ jobs:
305312
- "raspberry_pi_pico"
306313
- "raytac_mdbt50q-db-40"
307314
- "robohatmm1_m4"
308-
- "rotary_trinkey_m0"
309315
- "sam32"
310316
- "same54_xplained"
311317
- "seeeduino_wio_terminal"
@@ -317,6 +323,7 @@ jobs:
317323
- "simmel"
318324
- "snekboard"
319325
- "sparkfun_lumidrive"
326+
- "sparkfun_micromod_rp2040"
320327
- "sparkfun_nrf52840_micromod"
321328
- "sparkfun_nrf52840_mini"
322329
- "sparkfun_pro_micro_rp2040"
@@ -376,6 +383,8 @@ jobs:
376383
python3 --version
377384
- name: mpy-cross
378385
run: make -C mpy-cross -j2
386+
- name: Setup build failure matcher
387+
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
379388
- name: build
380389
run: python3 -u build_release_files.py
381390
working-directory: tools
@@ -425,6 +434,8 @@ jobs:
425434
python3 --version
426435
- name: mpy-cross
427436
run: make -C mpy-cross -j2
437+
- name: Setup build failure matcher
438+
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
428439
- name: build
429440
run: python3 -u build_release_files.py
430441
working-directory: tools
@@ -454,6 +465,7 @@ jobs:
454465
- "adafruit_magtag_2.9_grayscale"
455466
- "adafruit_metro_esp32s2"
456467
- "artisense_rd00"
468+
- "atmegazero_esp32s2"
457469
- "electroniccats_bastwifi"
458470
- "espressif_kaluga_1"
459471
- "espressif_saola_1_wroom"
@@ -486,7 +498,7 @@ jobs:
486498
id: idf-cache
487499
with:
488500
path: ${{ github.workspace }}/.idf_tools
489-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210304
501+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210422
490502
- name: Clone IDF submodules
491503
run: |
492504
(cd $IDF_PATH && git submodule update --init)
@@ -523,6 +535,8 @@ jobs:
523535
IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
524536
- name: mpy-cross
525537
run: make -C mpy-cross -j2
538+
- name: Setup build failure matcher
539+
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
526540
- name: build
527541
run: |
528542
source $IDF_PATH/export.sh
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"severity": "error",
5+
"pattern": [
6+
{
7+
"regexp": "^(Build .+ and \\x1b\\[31mfailed\\x1b\\[0m)$",
8+
"message": 1
9+
}
10+
],
11+
"owner": "build-failed"
12+
}
13+
]
14+
}

.gitmodules

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
url = https://github.com/adafruit/Adafruit_CircuitPython_Register.git
114114
[submodule "extmod/ulab"]
115115
path = extmod/ulab
116-
url = https://github.com/v923z/micropython-ulab
116+
url = https://github.com/adafruit/circuitpython-ulab
117117
[submodule "frozen/Adafruit_CircuitPython_ESP32SPI"]
118118
path = frozen/Adafruit_CircuitPython_ESP32SPI
119119
url = https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI
@@ -171,10 +171,16 @@
171171
[submodule "frozen/Adafruit_CircuitPython_LC709203F"]
172172
path = frozen/Adafruit_CircuitPython_LC709203F
173173
url = https://github.com/adafruit/Adafruit_CircuitPython_LC709203F
174+
[submodule "frozen/Adafruit_CircuitPython_SimpleMath"]
175+
path = frozen/Adafruit_CircuitPython_SimpleMath
176+
url = https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath
174177
[submodule "ports/raspberrypi/sdk"]
175178
path = ports/raspberrypi/sdk
176179
url = https://github.com/adafruit/pico-sdk.git
177180
[submodule "data/nvm.toml"]
178181
path = data/nvm.toml
179182
url = https://github.com/adafruit/nvm.toml.git
180183
branch = main
184+
[submodule "frozen/Adafruit_CircuitPython_MIDI"]
185+
path = frozen/Adafruit_CircuitPython_MIDI
186+
url = https://github.com/adafruit/Adafruit_CircuitPython_MIDI

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013, 2014 Damien P. George
3+
Copyright (c) 2013-2019 Damien P. George
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ def apply(self, **kwargs):
489489

490490
def setup(app):
491491
app.add_css_file("customstyle.css")
492+
app.add_css_file("filter.css")
493+
app.add_js_file("filter.js")
492494
app.add_config_value('redirects_file', 'redirects', 'env')
493495
app.connect('builder-inited', generate_redirects)
494496
app.add_transform(CoreModuleTransform)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,10 @@ uint16_t bleio_adapter_add_attribute(bleio_adapter_obj_t *adapter, mp_obj_t *att
886886
uint16_t handle = (uint16_t)adapter->attributes->len;
887887
mp_obj_list_append(adapter->attributes, attribute);
888888

889-
if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) {
889+
if (mp_obj_is_type(attribute, &bleio_service_type)) {
890890
adapter->last_added_service_handle = handle;
891891
}
892-
if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) {
892+
if (mp_obj_is_type(attribute, &bleio_characteristic_type)) {
893893
adapter->last_added_characteristic_handle = handle;
894894
}
895895

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333

3434

3535
bleio_uuid_obj_t *bleio_attribute_get_uuid(mp_obj_t *attribute) {
36-
if (MP_OBJ_IS_TYPE(attribute, &bleio_characteristic_type)) {
36+
if (mp_obj_is_type(attribute, &bleio_characteristic_type)) {
3737
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(attribute);
3838
return characteristic->uuid;
3939
}
40-
if (MP_OBJ_IS_TYPE(attribute, &bleio_descriptor_type)) {
40+
if (mp_obj_is_type(attribute, &bleio_descriptor_type)) {
4141
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(attribute);
4242
return descriptor->uuid;
4343
}
44-
if (MP_OBJ_IS_TYPE(attribute, &bleio_service_type)) {
44+
if (mp_obj_is_type(attribute, &bleio_service_type)) {
4545
bleio_service_obj_t *service = MP_OBJ_TO_PTR(attribute);
4646
return service->uuid;
4747
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_character
7878
return self->service;
7979
}
8080

81+
size_t common_hal_bleio_characteristic_get_max_length(bleio_characteristic_obj_t *self) {
82+
return self->max_length;
83+
}
84+
8185
size_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self, uint8_t *buf, size_t len) {
8286
// Do GATT operations only if this characteristic has been added to a registered service.
8387
if (self->handle != BLE_GATT_HANDLE_INVALID) {
@@ -209,9 +213,9 @@ bool bleio_characteristic_set_local_value(bleio_characteristic_obj_t *self, mp_b
209213

210214
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
211215

212-
if (MP_OBJ_IS_TYPE(self->observer, &bleio_characteristic_buffer_type)) {
216+
if (mp_obj_is_type(self->observer, &bleio_characteristic_buffer_type)) {
213217
bleio_characteristic_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo);
214-
} else if (MP_OBJ_IS_TYPE(self->observer, &bleio_packet_buffer_type)) {
218+
} else if (mp_obj_is_type(self->observer, &bleio_packet_buffer_type)) {
215219
bleio_packet_buffer_update(MP_OBJ_FROM_PTR(self->observer), bufinfo);
216220
} else {
217221
return false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern
644644
// mp_obj_t iterable = mp_getiter(service_uuids_whitelist, &iter_buf);
645645
// mp_obj_t uuid_obj;
646646
// while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
647-
// if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
647+
// if (!mp_obj_is_type(uuid_obj, &bleio_uuid_type)) {
648648
// mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist"));
649649
// }
650650
// bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void bleio_packet_buffer_update(bleio_packet_buffer_obj_t *self, mp_buffer_info_
8181

8282
void common_hal_bleio_packet_buffer_construct(
8383
bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic,
84-
size_t buffer_size) {
84+
size_t buffer_size, size_t max_packet_size) {
8585

8686
self->characteristic = characteristic;
8787
self->client = self->characteristic->service->is_remote;
@@ -101,7 +101,7 @@ void common_hal_bleio_packet_buffer_construct(
101101
}
102102

103103
if (incoming) {
104-
if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + characteristic->max_length), false)) {
104+
if (!ringbuf_alloc(&self->ringbuf, buffer_size * (sizeof(uint16_t) + max_packet_size), false)) {
105105
mp_raise_ValueError(translate("Buffer too large and unable to allocate"));
106106
}
107107
}
@@ -110,12 +110,13 @@ void common_hal_bleio_packet_buffer_construct(
110110
self->packet_queued = false;
111111
self->pending_index = 0;
112112
self->pending_size = 0;
113-
self->outgoing[0] = m_malloc(characteristic->max_length, false);
114-
self->outgoing[1] = m_malloc(characteristic->max_length, false);
113+
self->outgoing[0] = m_malloc(max_packet_size, false);
114+
self->outgoing[1] = m_malloc(max_packet_size, false);
115115
} else {
116116
self->outgoing[0] = NULL;
117117
self->outgoing[1] = NULL;
118118
}
119+
self->max_packet_size = max_packet_size;
119120

120121
bleio_characteristic_set_observer(self->characteristic, self);
121122
}
@@ -243,15 +244,16 @@ mp_int_t common_hal_bleio_packet_buffer_get_outgoing_packet_length(bleio_packet_
243244
if (self->conn_handle != BLE_CONN_HANDLE_INVALID) {
244245
bleio_connection_internal_t *connection = bleio_conn_handle_to_connection(self->conn_handle);
245246
if (connection) {
246-
return MIN(common_hal_bleio_connection_get_max_packet_length(connection),
247-
self->characteristic->max_length);
247+
return MIN(MIN(common_hal_bleio_connection_get_max_packet_length(connection),
248+
self->max_packet_size),
249+
self->characteristic->max_length);
248250
}
249251
}
250252
// There's no current connection, so we don't know the MTU, and
251253
// we can't tell what the largest outgoing packet length would be.
252254
return -1;
253255
}
254-
return self->characteristic->max_length;
256+
return MIN(self->characteristic->max_length, self->max_packet_size);
255257
}
256258

257259
bool common_hal_bleio_packet_buffer_deinited(bleio_packet_buffer_obj_t *self) {

0 commit comments

Comments
 (0)