Skip to content

Commit 0b81b96

Browse files
committed
Disable uart interrupt in uart_debug_write
1 parent 49eb0b8 commit 0b81b96

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/arduino/stm32/uart.c

+4
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,16 @@ size_t uart_debug_write(uint8_t *data, uint32_t size)
607607
index = serial_debug.index;
608608
}
609609

610+
HAL_NVIC_DisableIRQ(serial_debug.irq);
611+
610612
while (HAL_UART_Transmit(uart_handlers[index], data, size, TX_TIMEOUT) != HAL_OK) {
611613
if ((HAL_GetTick() - tickstart) >= TX_TIMEOUT) {
614+
HAL_NVIC_EnableIRQ(serial_debug.irq);
612615
return 0;
613616
}
614617
}
615618

619+
HAL_NVIC_EnableIRQ(serial_debug.irq);
616620
return size;
617621
}
618622

0 commit comments

Comments
 (0)