stmhal: Use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate.

This commit is contained in:
Damien George 2017-02-06 15:10:03 +11:00
parent dee47949cc
commit 8400351d5a
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ int mp_hal_stdin_rx_chr(void) {
} else if (MP_STATE_PORT(pyb_stdio_uart) != NULL && uart_rx_any(MP_STATE_PORT(pyb_stdio_uart))) {
return uart_rx_char(MP_STATE_PORT(pyb_stdio_uart));
}
__WFI();
MICROPY_EVENT_POLL_HOOK
}
}

View File

@ -334,7 +334,7 @@ STATIC bool uart_rx_wait(pyb_uart_obj_t *self, uint32_t timeout) {
if (HAL_GetTick() - start >= timeout) {
return false; // timeout
}
__WFI();
MICROPY_EVENT_POLL_HOOK
}
}
@ -375,7 +375,7 @@ STATIC bool uart_tx_wait(pyb_uart_obj_t *self, uint32_t timeout) {
if (HAL_GetTick() - start >= timeout) {
return false; // timeout
}
__WFI();
MICROPY_EVENT_POLL_HOOK
}
}