Skip to content

Commit

Permalink
Merge pull request #185 from ligenxxxx/set-uart-baudrate-only-once
Browse files Browse the repository at this point in the history
set uart baudrate only when init
  • Loading branch information
ligenxxxx authored Jan 6, 2024
2 parents af15197 + c58fc12 commit 380e46d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -1512,12 +1512,15 @@ void uart_baudrate_detect(void) {
// tramp protocol need 115200 bps.
return;
#else
if (seconds - msp_lst_rcv_sec >= 20) {
msp_lst_rcv_sec = seconds;
BAUDRATE++;
CFG_Back();
uart_set_baudrate(BAUDRATE);
Setting_Save();
static uint8_t once_done = 0;
if (once_done == 0) {
if (seconds - msp_lst_rcv_sec >= 10) {
msp_lst_rcv_sec = seconds;
BAUDRATE++;
CFG_Back();
Setting_Save();
once_done = 1;
}
}
#endif
}
Expand Down

0 comments on commit 380e46d

Please sign in to comment.