avr: Fix missing SP definition in newer avr-libc and missing include in adc.c (#7233)

compatibility fix for newer avr-libc - define stack pointer

add missing avr/io.h include to adc.c

add missing avr/io.h include to spi.c

Signed-off-by: Nicolás Méndez <9phhsyrbm@relay.firefox.com>
This commit is contained in:
Nicolás A. Méndez
2026-03-24 13:51:44 -03:00
committed by GitHub
parent 594ec7e120
commit 0c2416ea7f
3 changed files with 8 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <avr/io.h> // ADCSRA
#include "autoconf.h" // CONFIG_MACH_atmega644p
#include "command.h" // shutdown
#include "gpio.h" // gpio_adc_read

View File

@@ -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);

View File

@@ -4,6 +4,7 @@
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <avr/io.h> // SPCR
#include "autoconf.h" // CONFIG_MACH_atmega644p
#include "command.h" // shutdown
#include "gpio.h" // spi_setup