@@ -57,6 +57,22 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
57
57
// TODO: Have we already configured this UART hardware instance?!
58
58
WS_DEBUG_PRINTLN (" [uart] Configuring UART hardware instance..." );
59
59
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" );
60
76
UARTHardware *uart_hardware = new UARTHardware (cfg_serial);
61
77
if (!uart_hardware->ConfigureSerial ()) {
62
78
WS_DEBUG_PRINTLN (" [uart] ERROR: Failed to configure UART hardware!" );
@@ -128,7 +144,7 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
128
144
cfg_device.config .pm25aqi .sensor_types ,
129
145
cfg_device.config .pm25aqi .sensor_types_count );
130
146
uart_driver->SetSensorPeriod (cfg_device.config .pm25aqi .period );
131
- WS_DEBUG_PRINT (" added!" );
147
+ WS_DEBUG_PRINTLN (" added!" );
132
148
break ;
133
149
case wippersnapper_uart_UartDeviceType_UART_DEVICE_TYPE_TM22XX:
134
150
WS_DEBUG_PRINTLN (" [uart] TM22XX device type not implemented!" );
@@ -146,6 +162,7 @@ bool UARTController::Handle_UartAdd(pb_istream_t *stream) {
146
162
if (!is_gps_drv) {
147
163
WS_DEBUG_PRINTLN (" [uart] STD UART drv..." );
148
164
did_begin = uart_driver->begin ();
165
+ WS_DEBUG_PRINTLN (" [uart] STD UART driver initialized!" );
149
166
if (did_begin) {
150
167
WS_DEBUG_PRINTLN (" [uart] UART driver initialized successfully!" );
151
168
_uart_drivers.push_back (uart_driver);
0 commit comments