From 3128d71aac23f47aae474831a9d3632ee2d42fcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Jun 2021 14:04:02 +1000 Subject: [PATCH] HAL_ChibiOS: display uart even when not initialised don't rely on thread allocation for uart info display --- libraries/AP_HAL_ChibiOS/UARTDriver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp index 5d8c0ef8ae..cf777487a9 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp @@ -1673,8 +1673,12 @@ uint8_t UARTDriver::get_options(void) const void UARTDriver::uart_info(ExpandingString &str) { uint32_t now_ms = AP_HAL::millis(); - str.printf("%-5s TX%c=%8u RX%c=%8u TXBD=%6u RXBD=%6u\n", - uart_thread_name, + if (sdef.is_usb) { + str.printf("OTG%u ", unsigned(sdef.instance)); + } else { + str.printf("UART%u ", unsigned(sdef.instance)); + } + str.printf("TX%c=%8u RX%c=%8u TXBD=%6u RXBD=%6u\n", tx_dma_enabled ? '*' : ' ', unsigned(_tx_stats_bytes), rx_dma_enabled ? '*' : ' ',