Skip to content

Commit 4c85b5f

Browse files
committed
Fix other BLE builds
1 parent 63aeb11 commit 4c85b5f

File tree

7 files changed

+19
-2
lines changed

7 files changed

+19
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ bool vm_used_ble;
3737
// }
3838
// }
3939

40+
void common_hal_bleio_init(void) {
41+
}
42+
4043
void bleio_user_reset() {
4144
// HCI doesn't support the BLE workflow so just do a full reset.
4245
bleio_reset();

ports/nordic/common-hal/_bleio/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ void check_sec_status(uint8_t sec_status) {
7474
}
7575
}
7676

77+
void common_hal_bleio_init(void) {
78+
}
79+
7780
void bleio_user_reset() {
7881
// Stop any user scanning or advertising.
7982
common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj);

ports/silabs/common-hal/_bleio/PacketBuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void _common_hal_bleio_packet_buffer_construct(
145145
uint32_t *outgoing_buffer1,
146146
uint32_t *outgoing_buffer2,
147147
size_t max_packet_size,
148-
void *static_handler_entry) {
148+
ble_event_handler_t static_handler_entry) {
149149

150150
bleio_characteristic_properties_t temp_prop;
151151
self->characteristic = characteristic;

ports/silabs/common-hal/_bleio/PacketBuffer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ typedef struct {
5757
uint8_t len;
5858
} bleio_packet_buffer_obj_list_t;
5959

60+
// Unused
61+
typedef void *ble_event_handler_t;
62+
6063
extern bool packet_buffer_on_ble_evt(uint16_t attribute,
6164
uint8_t *data,
6265
uint16_t len);

ports/silabs/common-hal/_bleio/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ const osMutexAttr_t bluetooth_connection_mutex_attr = {
5151
.cb_size = osMutexCbSize
5252
};
5353

54+
void common_hal_bleio_init(void) {
55+
}
56+
5457
void bleio_user_reset() {
5558
// Stop any user scanning or advertising.
5659
common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj);

shared-bindings/_bleio/PacketBuffer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ extern const mp_obj_type_t bleio_packet_buffer_type;
2020
void common_hal_bleio_packet_buffer_construct(
2121
bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic,
2222
size_t buffer_size, size_t max_packet_size);
23-
// Allocation free
23+
// Allocation free version for BLE workflow use.
24+
#if CIRCUITPY_SERIAL_BLE || CIRCUITPY_BLE_FILE_SERVICE
2425
void _common_hal_bleio_packet_buffer_construct(
2526
bleio_packet_buffer_obj_t *self, bleio_characteristic_obj_t *characteristic,
2627
uint32_t *incoming_buffer, size_t incoming_buffer_size,
2728
uint32_t *outgoing_buffer1, uint32_t *outgoing_buffer2, size_t outgoing_buffer_size,
2829
ble_event_handler_t *static_handler_entry);
30+
#endif
2931
mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, const uint8_t *data, size_t len, uint8_t *header, size_t header_len);
3032
mp_int_t common_hal_bleio_packet_buffer_readinto(bleio_packet_buffer_obj_t *self, uint8_t *data, size_t len);
3133
mp_int_t common_hal_bleio_packet_buffer_get_incoming_packet_length(bleio_packet_buffer_obj_t *self);

supervisor/shared/bluetooth/serial.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const uint8_t circuitpython_base_uuid[16] = {0x6e, 0x68, 0x74, 0x79, 0x50, 0x74,
3636
static mp_obj_list_t characteristic_list;
3737
static mp_obj_t characteristic_list_items[3];
3838

39+
#if BLEIO_PACKET_BUFFER_MAX_PACKET_SIZE % 4 != 0
40+
#error "BLEIO_PACKET_BUFFER_MAX_PACKET_SIZE must be a multiple of 4"
41+
#endif
3942
static uint32_t _outgoing1[BLEIO_PACKET_BUFFER_MAX_PACKET_SIZE / 4];
4043
static uint32_t _outgoing2[BLEIO_PACKET_BUFFER_MAX_PACKET_SIZE / 4];
4144
static ble_event_handler_t rx_static_handler_entry;

0 commit comments

Comments
 (0)