Skip to content

Commit 2c3557d

Browse files
Merge branch 'adafruit:main' into seeduino-xiao-rp2040
2 parents c605171 + b9ecb0f commit 2c3557d

File tree

254 files changed

+4397
-843
lines changed

Some content is hidden

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

254 files changed

+4397
-843
lines changed

.readthedocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
version: 2
1010

11+
build:
12+
os: ubuntu-20.04
13+
tools:
14+
python: "3.9"
15+
1116
submodules:
1217
include:
1318
- extmod/ulab
@@ -16,6 +21,5 @@ formats:
1621
- pdf
1722

1823
python:
19-
version: 3
2024
install:
2125
- requirements: docs/requirements.txt

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
#include "shared-bindings/_bleio/__init__.h"
3535
#include "shared-bindings/_bleio/Connection.h"
36+
#include "shared-bindings/_bleio/CharacteristicBuffer.h"
3637
#include "supervisor/shared/tick.h"
3738
#include "common-hal/_bleio/CharacteristicBuffer.h"
3839

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ typedef struct {
8585
uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self);
8686
mp_obj_t bleio_connection_new_from_internal(bleio_connection_internal_t *connection);
8787
bleio_connection_internal_t *bleio_conn_handle_to_connection(uint16_t conn_handle);
88+
void bleio_connection_clear(bleio_connection_internal_t *self);
8889

8990
#endif // MICROPY_INCLUDED_BLE_HCI_COMMON_HAL_CONNECTION_H

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// Derived from ArduinoBLE.
22
// Copyright 2020 Dan Halbert for Adafruit Industries
33

4+
// Some functions here are unused now, but may be used in the future.
5+
// Don't warn or error about this, and depend on the compiler & linker to
6+
// eliminate the associated code.
7+
#pragma GCC diagnostic ignored "-Wunused"
8+
#pragma GCC diagnostic ignored "-Wunused-function"
9+
410
/*
511
This file is part of the ArduinoBLE library.
612
Copyright (c) 2018 Arduino SA. All rights reserved.
@@ -26,6 +32,7 @@
2632
// Zephyr include files to define HCI communication values and structs.
2733
// #include "hci_include/hci.h"
2834
// #include "hci_include/hci_err.h"
35+
#include "hci_include/att_internal.h"
2936
#include "hci_include/l2cap_internal.h"
3037

3138
#include "py/obj.h"
@@ -856,7 +863,7 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
856863
}
857864
}
858865

859-
int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) {
866+
static int att_find_info_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint8_t response_buffer[]) {
860867
struct __packed req {
861868
struct bt_att_hdr h;
862869
struct bt_att_find_info_req r;
@@ -924,7 +931,7 @@ STATIC void process_find_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
924931
}
925932
}
926933

927-
void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
934+
static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, uint8_t data[]) {
928935
struct bt_att_read_group_req *req = (struct bt_att_read_group_req *)data;
929936
uint16_t type_uuid = req->uuid[0] | (req->uuid[1] << 8);
930937

@@ -1008,7 +1015,7 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui
10081015
}
10091016
}
10101017

1011-
int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) {
1018+
static int att_read_group_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t uuid, uint8_t response_buffer[]) {
10121019

10131020
typedef struct __packed {
10141021
struct bt_att_hdr h;
@@ -1304,7 +1311,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
13041311
}
13051312
}
13061313

1307-
int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) {
1314+
static int att_read_type_req(uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, uint16_t type, uint8_t response_buffer[]) {
13081315
typedef struct __packed {
13091316
struct bt_att_hdr h;
13101317
struct bt_att_read_type_req r;
@@ -1714,7 +1721,7 @@ void att_process_data(uint16_t conn_handle, uint8_t dlen, uint8_t data[]) {
17141721
}
17151722

17161723
// FIX Do we need all of these?
1717-
void check_att_err(uint8_t err) {
1724+
static void check_att_err(uint8_t err) {
17181725
const compressed_string_t *msg = NULL;
17191726
switch (err) {
17201727
case 0:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* SPDX-License-Identifier: Apache-2.0
99
*/
1010

11+
#pragma once
1112

1213
#include <stdbool.h>
1314
// for __packed

extmod/moduselect.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ STATIC mp_obj_t select_select(size_t n_args, const mp_obj_t *args) {
150150
mp_map_deinit(&poll_map);
151151
return mp_obj_new_tuple(3, list_array);
152152
}
153-
MICROPY_EVENT_POLL_HOOK
153+
RUN_BACKGROUND_TASKS;
154154
}
155155
}
156156
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_select_select_obj, 3, 4, select_select);
@@ -229,7 +229,7 @@ STATIC mp_uint_t poll_poll_internal(uint n_args, const mp_obj_t *args) {
229229
if (n_ready > 0 || (timeout != (mp_uint_t)-1 && mp_hal_ticks_ms() - start_tick >= timeout)) {
230230
break;
231231
}
232-
MICROPY_EVENT_POLL_HOOK
232+
RUN_BACKGROUND_TASKS;
233233
}
234234

235235
return n_ready;
@@ -318,10 +318,13 @@ STATIC MP_DEFINE_CONST_DICT(poll_locals_dict, poll_locals_dict_table);
318318

319319
STATIC const mp_obj_type_t mp_type_poll = {
320320
{ &mp_type_type },
321+
.flags = MP_TYPE_FLAG_EXTENDED,
321322
.name = MP_QSTR_poll,
322-
.getiter = mp_identity_getiter,
323-
.iternext = poll_iternext,
324323
.locals_dict = (void *)&poll_locals_dict,
324+
MP_TYPE_EXTENDED_FIELDS(
325+
.getiter = mp_identity_getiter,
326+
.iternext = poll_iternext,
327+
),
325328
};
326329

327330
// poll()
@@ -354,4 +357,6 @@ const mp_obj_module_t mp_module_uselect = {
354357
.globals = (mp_obj_dict_t *)&mp_module_select_globals,
355358
};
356359

360+
MP_REGISTER_MODULE(MP_QSTR_select, mp_module_uselect, MICROPY_PY_USELECT);
361+
357362
#endif // MICROPY_PY_USELECT

0 commit comments

Comments
 (0)