@@ -160,7 +160,6 @@ struct _mp_btstack_pending_op_t {
160
160
uint8_t buf [];
161
161
};
162
162
163
- // Must hold MICROPY_PY_BLUETOOTH_ENTER.
164
163
STATIC void btstack_remove_pending_operation (mp_btstack_pending_op_t * pending_op , bool del ) {
165
164
bool removed = btstack_linked_list_remove (& MP_STATE_PORT (bluetooth_btstack_root_pointers )-> pending_ops , (btstack_linked_item_t * )pending_op );
166
165
assert (removed );
@@ -174,7 +173,6 @@ STATIC void btstack_remove_pending_operation(mp_btstack_pending_op_t *pending_op
174
173
// att_server_request_to_send_notification.
175
174
// We now have an opportunity to re-try the operation with an empty ACL buffer.
176
175
STATIC void btstack_notify_indicate_ready_handler (void * context ) {
177
- MICROPY_PY_BLUETOOTH_ENTER
178
176
mp_btstack_pending_op_t * pending_op = (mp_btstack_pending_op_t * )context ;
179
177
DEBUG_printf ("btstack_notify_indicate_ready_handler op_type=%d conn_handle=%d value_handle=%d len=%zu\n" , pending_op -> op_type , pending_op -> conn_handle , pending_op -> value_handle , pending_op -> len );
180
178
if (pending_op -> op_type == MP_BLUETOOTH_BTSTACK_PENDING_NOTIFY ) {
@@ -191,7 +189,6 @@ STATIC void btstack_notify_indicate_ready_handler(void *context) {
191
189
}
192
190
// Can't free the pending op as we're in IRQ context. Leave it for the GC.
193
191
btstack_remove_pending_operation (pending_op , false /* del */ );
194
- MICROPY_PY_BLUETOOTH_EXIT
195
192
}
196
193
197
194
// Register a pending background operation -- copies the buffer, and makes it known to the GC.
@@ -209,11 +206,9 @@ STATIC mp_btstack_pending_op_t *btstack_enqueue_pending_operation(uint16_t op_ty
209
206
pending_op -> context_registration .context = pending_op ;
210
207
}
211
208
212
- MICROPY_PY_BLUETOOTH_ENTER
213
209
bool added = btstack_linked_list_add (& MP_STATE_PORT (bluetooth_btstack_root_pointers )-> pending_ops , (btstack_linked_item_t * )pending_op );
214
210
assert (added );
215
211
(void )added ;
216
- MICROPY_PY_BLUETOOTH_EXIT
217
212
218
213
return pending_op ;
219
214
}
@@ -226,7 +221,6 @@ STATIC mp_btstack_pending_op_t *btstack_enqueue_pending_operation(uint16_t op_ty
226
221
// TODO: Can we make btstack give us the value_handle for regular write (with response) so that we
227
222
// know for sure that we're using the correct entry.
228
223
STATIC mp_btstack_pending_op_t * btstack_finish_pending_operation (uint16_t op_type , uint16_t conn_handle , uint16_t value_handle , bool del ) {
229
- MICROPY_PY_BLUETOOTH_ENTER
230
224
DEBUG_printf ("btstack_finish_pending_operation op_type=%d conn_handle=%d value_handle=%d\n" , op_type , conn_handle , value_handle );
231
225
btstack_linked_list_iterator_t it ;
232
226
btstack_linked_list_iterator_init (& it , & MP_STATE_PORT (bluetooth_btstack_root_pointers )-> pending_ops );
@@ -236,12 +230,10 @@ STATIC mp_btstack_pending_op_t *btstack_finish_pending_operation(uint16_t op_typ
236
230
if (pending_op -> op_type == op_type && pending_op -> conn_handle == conn_handle && (value_handle == 0xffff || pending_op -> value_handle == value_handle )) {
237
231
DEBUG_printf ("btstack_finish_pending_operation: found value_handle=%d len=%zu\n" , pending_op -> value_handle , pending_op -> len );
238
232
btstack_remove_pending_operation (pending_op , del );
239
- MICROPY_PY_BLUETOOTH_EXIT
240
233
return del ? NULL : pending_op ;
241
234
}
242
235
}
243
236
DEBUG_printf ("btstack_finish_pending_operation: not found\n" );
244
- MICROPY_PY_BLUETOOTH_EXIT
245
237
return NULL ;
246
238
}
247
239
#endif
@@ -1118,9 +1110,7 @@ int mp_bluetooth_gatts_notify_send(uint16_t conn_handle, uint16_t value_handle,
1118
1110
}
1119
1111
1120
1112
// Attempt to send immediately. If it succeeds, btstack will copy the buffer.
1121
- MICROPY_PY_BLUETOOTH_ENTER
1122
1113
int err = att_server_notify (conn_handle , value_handle , value , value_len );
1123
- MICROPY_PY_BLUETOOTH_EXIT
1124
1114
1125
1115
if (err == BTSTACK_ACL_BUFFERS_FULL ) {
1126
1116
DEBUG_printf ("mp_bluetooth_gatts_notify_send: ACL buffer full, scheduling callback\n" );
@@ -1155,9 +1145,7 @@ int mp_bluetooth_gatts_indicate(uint16_t conn_handle, uint16_t value_handle) {
1155
1145
// acknowledged (or timeout/error).
1156
1146
1157
1147
// Attempt to send immediately, will copy buffer.
1158
- MICROPY_PY_BLUETOOTH_ENTER
1159
1148
int err = att_server_indicate (conn_handle , value_handle , data , len );
1160
- MICROPY_PY_BLUETOOTH_EXIT
1161
1149
1162
1150
if (err == BTSTACK_ACL_BUFFERS_FULL ) {
1163
1151
DEBUG_printf ("mp_bluetooth_gatts_indicate: ACL buffer full, scheduling callback\n" );
0 commit comments