aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-pcint.c
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster/fsm-pcint.c')
-rw-r--r--spaghetti-monster/fsm-pcint.c9
1 files changed, 9 insertions, 0 deletions
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