HAL_ChibiOS: added a method for just changing port owner

This commit is contained in:
Andrew Tridgell 2023-08-01 17:18:17 +10:00
parent a5fd60ec71
commit 0ed33653fc

View File

@ -231,6 +231,12 @@ static int hal_console_vprintf(const char *fmt, va_list arg)
void UARTDriver::_begin(uint32_t b, uint16_t rxS, uint16_t txS)
{
if (b == 0 && txS == 0 && rxS == 0 && _tx_initialised && _rx_initialised) {
// just changing port owner
_uart_owner_thd = chThdGetSelfX();
return;
}
thread_rx_init();
if (sdef.serial == nullptr) {