fix: Internal PXX exclusive S.PORT (#3822)

This commit is contained in:
Raphael Coeffic
2023-10-13 09:48:32 +10:00
committed by GitHub
parent c270ec18bf
commit ff2b3ac22a
24 changed files with 435 additions and 186 deletions
@@ -226,7 +226,6 @@ static void _on_rx_fifo(uint8_t data)
static void* stm32_serial_init(void* hw_def, const etx_serial_init* params)
{
// TODO: check if port is already in use
auto sp = (const stm32_serial_port*)hw_def;
if (!sp) return nullptr;
@@ -234,8 +233,8 @@ static void* stm32_serial_init(void* hw_def, const etx_serial_init* params)
auto st = stm32_serial_find_state(usart);
if (!st || st->sp) return nullptr;
stm32_usart_init(usart, params);
st->sp = sp; // TODO: only iff init() is sucessful
if (!stm32_usart_init(usart, params)) return nullptr;
st->sp = sp;
if (params->direction & ETX_Dir_TX) {
// prepare for send_byte()