File tree 2 files changed +7
-11
lines changed
2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ void UartClass::begin(unsigned long baud, uint16_t config)
160
160
error = 1 ;
161
161
}
162
162
163
- // ********Check if desired baud rate is within the acceptable range for using normal RX-mode********
164
- // Condition from datasheet
165
- // This limits the minimum baud_setting value to 64 (0x0040)
163
+ // ********Check if desired baud rate is within the acceptable range for using normal RX-mode********
164
+ // Condition from datasheet
165
+ // This limits the minimum baud_setting value to 64 (0x0040)
166
166
} else if ((16 * baud <= F_CPU_CORRECTED)) {
167
167
168
168
// Check that the desired baud rate is not so low that it will
@@ -195,6 +195,10 @@ void UartClass::begin(unsigned long baud, uint16_t config)
195
195
digitalWrite (_hwserial_tx_pin, HIGH);
196
196
pinMode (_hwserial_tx_pin, OUTPUT);
197
197
198
+ int8_t sigrow_val = SIGROW.OSC16ERR5V ;
199
+ baud_setting *= (1024 + sigrow_val);
200
+ baud_setting /= 1024 ;
201
+
198
202
// assign the baud_setting, a.k.a. BAUD (USART Baud Rate Register)
199
203
(*_hwserial_module).BAUD = (int16_t ) baud_setting;
200
204
Original file line number Diff line number Diff line change @@ -313,14 +313,6 @@ void init()
313
313
_PROTECTED_WRITE (CLKCTRL_MCLKCTRLB , 0x00 );
314
314
#endif
315
315
316
-
317
- #if (PERFORM_SIGROW_CORRECTION_F_CPU == 1 )
318
- /* Calculate actual F_CPU with error values from signature row */
319
- int8_t sigrow_val = SIGROW .OSC16ERR5V ;
320
- cpu_freq *= (1024 + sigrow_val );
321
- cpu_freq /= 1024 ;
322
- #endif /* (CORRECT_F_CPU == 1) */
323
-
324
316
/* Apply calculated value to F_CPU_CORRECTED */
325
317
F_CPU_CORRECTED = (uint32_t )cpu_freq ;
326
318
You can’t perform that action at this time.
0 commit comments