aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-24 09:58:42 -0400
committerKevin O'Connor <kevin@koconnor.net>2021-08-14 22:00:17 -0400
commit070fac07029ba81c990cc6f26dde8d6941042dd2 (patch)
tree4e0fb5c8383869eebee65715090c06e0d8b44694
parentcf3c7cd99afccdb20b7b015a3e8b80555d4986ad (diff)
downloadkutter-070fac07029ba81c990cc6f26dde8d6941042dd2.tar.gz
kutter-070fac07029ba81c990cc6f26dde8d6941042dd2.tar.xz
kutter-070fac07029ba81c990cc6f26dde8d6941042dd2.zip
avr: Define PORTE on atmega328p
The atmega328pb supports PORTE, but the current avr-libc toolchain doesn't support the atmega328pb. So, for now, add support for PORTE to atmega328p. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/avr/adc.c2
-rw-r--r--src/avr/gpio.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/avr/adc.c b/src/avr/adc.c
index 25b979e0..1d16368d 100644
--- a/src/avr/adc.c
+++ b/src/avr/adc.c
@@ -34,7 +34,7 @@ static const uint8_t adc_pins[] PROGMEM = {
};
// The atmega168/328 have two analog only pins
-#if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328 || CONFIG_MACH_atmega328p
+#if CONFIG_MACH_atmega168 || CONFIG_MACH_atmega328
DECL_ENUMERATION_RANGE("pin", "PE2", GPIO('E', 2), 2);
#endif
diff --git a/src/avr/gpio.c b/src/avr/gpio.c
index 03d6aff5..c749c4f1 100644
--- a/src/avr/gpio.c
+++ b/src/avr/gpio.c
@@ -18,6 +18,9 @@ DECL_ENUMERATION_RANGE("pin", "PA0", GPIO('A', 0), 8);
DECL_ENUMERATION_RANGE("pin", "PB0", GPIO('B', 0), 8);
DECL_ENUMERATION_RANGE("pin", "PC0", GPIO('C', 0), 8);
DECL_ENUMERATION_RANGE("pin", "PD0", GPIO('D', 0), 8);
+#ifdef CONFIG_MACH_atmega328p
+DECL_ENUMERATION_RANGE("pin", "PE0", GPIO('E', 0), 8);
+#endif
#ifdef PINE
DECL_ENUMERATION_RANGE("pin", "PE0", GPIO('E', 0), 8);
DECL_ENUMERATION_RANGE("pin", "PF0", GPIO('F', 0), 8);
@@ -37,6 +40,9 @@ volatile uint8_t * const digital_regs[] PROGMEM = {
NULL,
#endif
&PINB, &PINC, &PIND,
+#ifdef CONFIG_MACH_atmega328p
+ &_SFR_IO8(0x0C), // PINE on atmega328pb
+#endif
#ifdef PINE
&PINE, &PINF,
#endif