8000 stm32/nimble_hci_uart.c: Prevent scheduler running during CYW-BT wakeup. · rlangoy/micropython@fbb7646 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbb7646

Browse files
jimmodpgeorge
authored andcommitted
stm32/nimble_hci_uart.c: Prevent scheduler running during CYW-BT wakeup.
Using mp_hal_delay_ms allows the scheduler to run, which might result in another transmit operation happening, which would bypass the sleep (and fail). Use mp_hal_delay_us instead.
1 parent 438c0dc commit fbb7646

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ports/stm32/nimble_hci_uart.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ void nimble_hci_uart_tx_strn(const char *str, uint len) {
162162
if (mp_hal_pin_read(pyb_pin_BT_DEV_WAKE) == 1) {
163163
//printf("BT WAKE for TX\n");
164164
mp_hal_pin_low(pyb_pin_BT_DEV_WAKE); // wake up
165-
mp_hal_delay_ms(5); // can't go lower than this
165+
// Use delay_us rather than delay_ms to prevent running the scheduler (which
166+
// might result in more BLE operations).
167+
mp_hal_delay_us(5000); // can't go lower than this
166168
}
167169
#endif
168170

0 commit comments

Comments
 (0)
0