Skip to content

Commit

Permalink
Make sure we are done writing before setting a new baudrate
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Nov 20, 2024
1 parent 1787306 commit a5511d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/asic/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ void SERIAL_init(void)
void SERIAL_set_baud(int baud)
{
ESP_LOGI(TAG, "Changing UART baud to %i", baud);

// Make sure that we are done writing before setting a new baudrate.
uart_wait_tx_done(UART_NUM_1, 1000 / portTICK_PERIOD_MS);

uart_set_baudrate(UART_NUM_1, baud);
}

Expand Down

0 comments on commit a5511d2

Please sign in to comment.