Skip to content

Commit 680a960

Browse files
committed
fix: skip flust when serial is not initialized
1 parent 6eae3a2 commit 680a960

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/acoustics-porting/porting/transport/uart_console.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ class TransportUARTConsole final: public hal::Transport
160160

161161
inline int flush() noexcept override
162162
{
163+
if (!initialized()) [[unlikely]]
164+
{
165+
return 0; // Not initialized, nothing to flush
166+
}
163167
return usb_serial_jtag_wait_tx_done(portMAX_DELAY);
164168
}
165169

0 commit comments

Comments
 (0)