@@ -57,6 +57,22 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
5757 // TODO: Have we already configured this UART hardware instance?!
5858 WS_DEBUG_PRINTLN (" [uart] Configuring UART hardware instance..." );
5959 wippersnapper_uart_UartSerialConfig cfg_serial = add_msg->cfg_serial ;
60+ // Print out the UART configuration for debugging
61+ WS_DEBUG_PRINTLN (" [uart] UART Serial Configuration:" );
62+ WS_DEBUG_PRINT (" [uart] RX Pin: " );
63+ WS_DEBUG_PRINTLN (cfg_serial.pin_rx );
64+ WS_DEBUG_PRINT (" [uart] TX Pin: " );
65+ WS_DEBUG_PRINTLN (cfg_serial.pin_tx );
66+ WS_DEBUG_PRINT (" [uart] UART Number: " );
67+ WS_DEBUG_PRINTLN (cfg_serial.uart_nbr );
68+ WS_DEBUG_PRINT (" [uart] Baud Rate: " );
69+ WS_DEBUG_PRINTLN (cfg_serial.baud_rate );
70+ WS_DEBUG_PRINT (" [uart] Packet Format: " );
71+ WS_DEBUG_PRINTLN (cfg_serial.format );
72+ WS_DEBUG_PRINT (" [uart] Timeout: " );
73+ WS_DEBUG_PRINTLN (cfg_serial.timeout );
74+ WS_DEBUG_PRINT (" [uart] Use Software Serial: " );
75+ WS_DEBUG_PRINTLN (cfg_serial.use_sw_serial ? " True" : " False" );
6076 UARTHardware *uart_hardware = new UARTHardware (cfg_serial);
6177 if (!uart_hardware->ConfigureSerial ()) {
6278 WS_DEBUG_PRINTLN (" [uart] ERROR: Failed to configure UART hardware!" );
@@ -128,7 +144,7 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
128144 cfg_device.config .pm25aqi .sensor_types ,
129145 cfg_device.config .pm25aqi .sensor_types_count );
130146 uart_driver->SetSensorPeriod (cfg_device.config .pm25aqi .period );
131- WS_DEBUG_PRINT (" added!" );
147+ WS_DEBUG_PRINTLN (" added!" );
132148 break ;
133149 case wippersnapper_uart_UartDeviceType_UART_DEVICE_TYPE_TM22XX:
134150 WS_DEBUG_PRINTLN (" [uart] TM22XX device type not implemented!" );
@@ -146,6 +162,7 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
146162 if (!is_gps_drv) {
147163 WS_DEBUG_PRINTLN (" [uart] STD UART drv..." );
148164 did_begin = uart_driver->begin ();
165+ WS_DEBUG_PRINTLN (" [uart] STD UART driver initialized!" );
149166 if (did_begin) {
150167 WS_DEBUG_PRINTLN (" [uart] UART driver initialized successfully!" );
151168 _uart_drivers.push_back (uart_driver);
0 commit comments