Skip to content

Commit 642be1c

Browse files
committed
Improved baud rate settings formula
1 parent e7a0b8a commit 642be1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/UART.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void UartClass::begin(unsigned long baud, uint16_t config)
197197

198198
int8_t sigrow_val = SIGROW.OSC16ERR5V;
199199
baud_setting *= (1024 + sigrow_val);
200-
baud_setting /= 1024;
200+
baud_setting /= (1024 - sigrow_val);
201201

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

0 commit comments

Comments
 (0)