diff --git a/src/avr/adc.c b/src/avr/adc.c index 99fd063f6..e94dfbc57 100644 --- a/src/avr/adc.c +++ b/src/avr/adc.c @@ -4,6 +4,7 @@ // // This file may be distributed under the terms of the GNU GPLv3 license. +#include // ADCSRA #include "autoconf.h" // CONFIG_MACH_atmega644p #include "command.h" // shutdown #include "gpio.h" // gpio_adc_read diff --git a/src/avr/main.c b/src/avr/main.c index 0523af411..b0d299dac 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -12,6 +12,12 @@ #include "irq.h" // irq_enable #include "sched.h" // sched_main +// Newer avr-libc headers expose the stack pointer as SP instead of the +// older AVR_STACK_POINTER_REG alias used by Klipper. +#ifndef AVR_STACK_POINTER_REG +#define AVR_STACK_POINTER_REG SP +#endif + DECL_CONSTANT_STR("MCU", CONFIG_MCU); diff --git a/src/avr/spi.c b/src/avr/spi.c index 55eb1f58c..d8acd45da 100644 --- a/src/avr/spi.c +++ b/src/avr/spi.c @@ -4,6 +4,7 @@ // // This file may be distributed under the terms of the GNU GPLv3 license. +#include // SPCR #include "autoconf.h" // CONFIG_MACH_atmega644p #include "command.h" // shutdown #include "gpio.h" // spi_setup