Skip to content

Commit 22b72ad

Browse files
Merge pull request #3 from adafruit/main
From Main
2 parents cd7f5fe + 01979ac commit 22b72ad

File tree

116 files changed

+3298
-811
lines changed

Some content is hidden

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

116 files changed

+3298
-811
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') }}-20210415
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

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/Characteristic.c

Lines changed: 4 additions & 0 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) {

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct {
4242
// We remember the conn_handle so we can do a NOTIFY/INDICATE to a client.
4343
// We can find out the conn_handle on a Characteristic write or a CCCD write (but not a read).
4444
volatile uint16_t conn_handle;
45+
uint16_t max_packet_size;
4546
uint8_t pending_index;
4647
uint8_t write_type;
4748
bool client;

docs/static/filter.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#support-matrix-filter-block { position: relative; }
2+
#support-matrix-filter {
3+
width: 100%;
4+
}
5+
#support-matrix-filter-num {
6+
position: absolute;
7+
right: 10px;
8+
top: 4px;
9+
}
10+
.support-matrix-table .this_module code,
11+
.support-matrix-table .this_module span {
12+
background: black;
13+
color: white;
14+
}
15+
.support-matrix-table .board_hidden {
16+
display: none;
17+
}

docs/static/filter.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
$(() => {
2+
var urlTimeout = null;
3+
function setURL(query, value) {
4+
clearTimeout(urlTimeout);
5+
6+
urlTimeout = setTimeout(function() {
7+
var url = new URL(window.location.href);
8+
console.log(query,value,value.length,!value.length);
9+
if (!value.length) {
10+
console.log
11+
url.searchParams.delete(query);
12+
} else if (Array.isArray(value)) {
13+
url.searchParams.delete(query);
14+
value.forEach(function(v) {
15+
url.searchParams.append(query, v);
16+
})
17+
} else {
18+
url.searchParams.set(query, value);
19+
}
20+
21+
window.history.pushState(null, document.title, url.href);
22+
}, 1000);
23+
}
24+
25+
function handlePageLoad() {
26+
var url = new URL(window.location.href);
27+
//get values from URL
28+
var filters = url.searchParams.getAll('filter');
29+
search_terms = filters.join(" ");
30+
$("#support-matrix-filter").val(search_terms);
31+
run_filter();
32+
}
33+
34+
function filter_boards(search_string) {
35+
$(".board_hidden").removeClass("board_hidden");
36+
$(".this_module").removeClass("this_module");
37+
var nboards = $(".support-matrix-table tbody tr").length;
38+
if(search_string.trim() == "") {
39+
$("#support-matrix-filter-num").html("(all)");
40+
setURL("filter",[]);
41+
return;
42+
}
43+
var list_search = search_string.split(" ").filter(i => i);
44+
var nvisible = 0;
45+
$(".support-matrix-table tbody tr").each( (index,item) => {
46+
var name = $(item).find("td:first-child p").html();
47+
var modules = $(item).find("a.reference.internal");
48+
var matching_all = true;
49+
//
50+
list_search.forEach((sstring) => {
51+
var matching = (sstring[0] == "-");
52+
for(var modi = 0; modi < modules.length; ++modi) {
53+
module = modules[modi];
54+
var mod_name = module.firstChild.firstChild.textContent;
55+
if(sstring[0] == "-") {
56+
if(mod_name.match(sstring.substr(1))) {
57+
matching = false;
58+
break;
59+
}
60+
} else {
61+
if(mod_name.match(sstring)) {
62+
$(module).addClass("this_module");
63+
matching = true;
64+
}
65+
}
66+
}
67+
matching_all = matching_all && matching;
68+
});
69+
if(!matching_all) {
70+
$(item).addClass("board_hidden");
71+
} else {
72+
nvisible += 1;
73+
}
74+
});
75+
$("#support-matrix-filter-num").html(`(${nvisible}/${nboards})`);
76+
setURL("filter",list_search);
77+
}
78+
79+
function run_filter() {
80+
var search_string = $("#support-matrix-filter").val();
81+
filter_boards(search_string);
82+
}
83+
$("#support-matrix-filter").on("keyup", run_filter);
84+
// $(document).on("keyup", "#support-matrix-filter", run_filter);
85+
handlePageLoad();
86+
});

0 commit comments

Comments
 (0)