Skip to content

Commit 8400351

Browse files
committed
stmhal: Use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate.
1 parent dee4794 commit 8400351

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

stmhal/mphalport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int mp_hal_stdin_rx_chr(void) {
4343
} else if (MP_STATE_PORT(pyb_stdio_uart) != NULL && uart_rx_any(MP_STATE_PORT(pyb_stdio_uart))) {
4444
return uart_rx_char(MP_STATE_PORT(pyb_stdio_uart));
4545
}
46-
__WFI();
46+
MICROPY_EVENT_POLL_HOOK
4747
}
4848
}
4949

stmhal/uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ STATIC bool uart_rx_wait(pyb_uart_obj_t *self, uint32_t timeout) {
334334
if (HAL_GetTick() - start >= timeout) {
335335
return false; // timeout
336336
}
337-
__WFI();
337+
MICROPY_EVENT_POLL_HOOK
338338
}
339339
}
340340

@@ -375,7 +375,7 @@ STATIC bool uart_tx_wait(pyb_uart_obj_t *self, uint32_t timeout) {
375375
if (HAL_GetTick() - start >= timeout) {
376376
return false; // timeout
377377
}
378-
__WFI();
378+
MICROPY_EVENT_POLL_HOOK
379379
}
380380
}
381381

0 commit comments

Comments
 (0)