Skip to content

Commit

Permalink
set uart baudrate only when init
Browse files Browse the repository at this point in the history
  • Loading branch information
ligenxxxx committed Dec 27, 2023
1 parent af15197 commit c58fc12
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 c58fc12

Please sign in to comment.