mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 13:03:13 +00:00
Fix premature RX interrupt during serial configuration
This commit is contained in:
parent
534fe2fb26
commit
ded9b121ba
1 changed files with 7 additions and 4 deletions
|
@ -730,6 +730,13 @@ static void furi_hal_serial_async_rx_configure(
|
|||
FuriHalSerialHandle* handle,
|
||||
FuriHalSerialAsyncRxCallback callback,
|
||||
void* context) {
|
||||
// Handle must be configured before enabling RX interrupt
|
||||
// as it might be triggered right away on a misconfigured handle
|
||||
furi_hal_serial[handle->id].rx_byte_callback = callback;
|
||||
furi_hal_serial[handle->id].handle = handle;
|
||||
furi_hal_serial[handle->id].rx_dma_callback = NULL;
|
||||
furi_hal_serial[handle->id].context = context;
|
||||
|
||||
if(handle->id == FuriHalSerialIdUsart) {
|
||||
if(callback) {
|
||||
furi_hal_serial_usart_deinit_dma_rx();
|
||||
|
@ -753,10 +760,6 @@ static void furi_hal_serial_async_rx_configure(
|
|||
LL_LPUART_DisableIT_RXNE_RXFNE(LPUART1);
|
||||
}
|
||||
}
|
||||
furi_hal_serial[handle->id].rx_byte_callback = callback;
|
||||
furi_hal_serial[handle->id].handle = handle;
|
||||
furi_hal_serial[handle->id].rx_dma_callback = NULL;
|
||||
furi_hal_serial[handle->id].context = context;
|
||||
}
|
||||
|
||||
void furi_hal_serial_async_rx_start(
|
||||
|
|
Loading…
Reference in a new issue