Skip to content

Commit

Permalink
Merge pull request #21 from bcmi-labs/BaudRateTake2
Browse files Browse the repository at this point in the history
Improved baud rate settings formula
  • Loading branch information
facchinm authored Oct 19, 2018
2 parents e7a0b8a + 642be1c commit c7ccdfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/arduino/UART.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void UartClass::begin(unsigned long baud, uint16_t config)

int8_t sigrow_val = SIGROW.OSC16ERR5V;
baud_setting *= (1024 + sigrow_val);
baud_setting /= 1024;
baud_setting /= (1024 - sigrow_val);

// assign the baud_setting, a.k.a. BAUD (USART Baud Rate Register)
(*_hwserial_module).BAUD = (int16_t) baud_setting;
Expand Down

0 comments on commit c7ccdfe

Please sign in to comment.