mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-11 15:56:04 +01:00
avr: Remove F_CPU compile time definition
Directly use the Kconfig defined CONFIG_CLOCK_FREQ in the code and avoid defining F_CPU. Also, remove the unnecessary O2 option - that is already the default from the main makefile. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -30,10 +30,12 @@ serial_init(void)
|
||||
{
|
||||
if (CONFIG_SERIAL_BAUD_U2X) {
|
||||
UCSR0A = 1<<U2X0;
|
||||
UBRR0 = DIV_ROUND_CLOSEST(F_CPU, 8UL * CONFIG_SERIAL_BAUD) - 1UL;
|
||||
UBRR0 = DIV_ROUND_CLOSEST(
|
||||
CONFIG_CLOCK_FREQ, 8UL * CONFIG_SERIAL_BAUD) - 1UL;
|
||||
} else {
|
||||
UCSR0A = 0;
|
||||
UBRR0 = DIV_ROUND_CLOSEST(F_CPU, 16UL * CONFIG_SERIAL_BAUD) - 1UL;
|
||||
UBRR0 = DIV_ROUND_CLOSEST(
|
||||
CONFIG_CLOCK_FREQ, 16UL * CONFIG_SERIAL_BAUD) - 1UL;
|
||||
}
|
||||
|
||||
UCSR0C = (1<<UCSZ01) | (1<<UCSZ00);
|
||||
|
||||
Reference in New Issue
Block a user