File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,11 @@ CIRCUITPY_SERIAL_BLE = 0
328
328
endif
329
329
CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE )
330
330
331
+ ifndef CIRCUITPY_BLE_FILE_SERVICE
332
+ CIRCUITPY_BLE_FILE_SERVICE = 0
333
+ endif
334
+ CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE )
335
+
331
336
# REPL over UART
332
337
ifndef CIRCUITPY_SERIAL_UART
333
338
CIRCUITPY_SERIAL_UART = 0
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ mp_obj_list_t characteristic_list;
64
64
mp_obj_t characteristic_list_items [4 ];
65
65
66
66
void supervisor_bluetooth_start_advertising (void ) {
67
+ #if !CIRCUITPY_BLE_FILE_SERVICE
68
+ return ;
69
+ #endif
67
70
bool is_connected = common_hal_bleio_adapter_get_connected (& common_hal_bleio_adapter_obj );
68
71
if (is_connected ) {
69
72
return ;
@@ -79,6 +82,10 @@ void supervisor_bluetooth_start_advertising(void) {
79
82
}
80
83
81
84
void supervisor_start_bluetooth (void ) {
85
+ #if !CIRCUITPY_BLE_FILE_SERVICE
86
+ return ;
87
+ #endif
88
+
82
89
common_hal_bleio_adapter_set_enabled (& common_hal_bleio_adapter_obj , true);
83
90
84
91
supervisor_ble_service_uuid .base .type = & bleio_uuid_type ;
@@ -203,6 +210,9 @@ uint32_t current_command[1024 / sizeof(uint32_t)];
203
210
volatile size_t current_offset ;
204
211
205
212
void supervisor_bluetooth_background (void ) {
213
+ #if !CIRCUITPY_BLE_FILE_SERVICE
214
+ return ;
215
+ #endif
206
216
if (!run_ble_background ) {
207
217
return ;
208
218
}
@@ -296,6 +306,9 @@ void supervisor_bluetooth_background(void) {
296
306
297
307
// This happens in an interrupt so we need to be quick.
298
308
bool supervisor_bluetooth_hook (ble_evt_t * ble_evt ) {
309
+ #if !CIRCUITPY_BLE_FILE_SERVICE
310
+ return false;
311
+ #endif
299
312
// Catch writes to filename or contents. Length is read-only.
300
313
301
314
bool done = false;
You can’t perform that action at this time.
0 commit comments