From dbe0aaf636ccb78a3cc1281b6a1ea6c662af6756 Mon Sep 17 00:00:00 2001 From: Gabriel Hart Date: Fri, 18 Dec 2020 15:23:31 -0600 Subject: Add AVR 1-Series and t1616 board and scripts --- spaghetti-monster/fsm-pcint.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spaghetti-monster/fsm-pcint.c') diff --git a/spaghetti-monster/fsm-pcint.c b/spaghetti-monster/fsm-pcint.c index 24cc82c..4a3c193 100644 --- a/spaghetti-monster/fsm-pcint.c +++ b/spaghetti-monster/fsm-pcint.c @@ -46,6 +46,8 @@ inline void PCINT_on() { #else GIMSK |= (1 << SWITCH_PCIE); #endif + #elif defined(AVRXMEGA3) // ATTINY816, 817, etc) + SWITCH_ISC_REG |= PORT_ISC_BOTHEDGES_gc; #else #error Unrecognized MCU type #endif @@ -58,6 +60,8 @@ inline void PCINT_off() { #elif (ATTINY == 1634) // disable all pin-change interrupts GIMSK &= ~(1 << SWITCH_PCIE); + #elif defined(AVRXMEGA3) // ATTINY816, 817, etc) + SWITCH_ISC_REG &= ~(PORT_ISC_gm); #else #error Unrecognized MCU type #endif @@ -73,6 +77,11 @@ ISR(PCINT0_vect) { #endif irq_pcint = 1; } +#elif defined(AVRXMEGA3) // ATTINY816, 817, etc) +ISR(SWITCH_VECT) { + SWITCH_INTFLG |= (1 << SWITCH_PIN); // Write a '1' to clear the interrupt flag + irq_pcint = 1; +} #else #error Unrecognized MCU type #endif -- cgit v1.2.3