diff options
| author | Selene ToyKeeper | 2021-04-01 16:30:16 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2021-04-01 16:30:16 -0600 |
| commit | bc281fdece8f3913c9ae13503f6d049e8879e0ce (patch) | |
| tree | d96db6041a308caed35ee693389434263c901dd7 /spaghetti-monster/fsm-pcint.c | |
| parent | updated MODELS file with missing K9.3-nofet build target (diff) | |
| parent | Merge TKs changes from 2021-01-25 (diff) | |
| download | anduril-bc281fdece8f3913c9ae13503f6d049e8879e0ce.tar.gz anduril-bc281fdece8f3913c9ae13503f6d049e8879e0ce.tar.bz2 anduril-bc281fdece8f3913c9ae13503f6d049e8879e0ce.zip | |
merged gchart's Tiny1 series branch for tiny1616 support
Diffstat (limited to 'spaghetti-monster/fsm-pcint.c')
| -rw-r--r-- | spaghetti-monster/fsm-pcint.c | 9 |
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 |
