diff options
| author | Gabriel Hart | 2020-12-18 15:23:31 -0600 |
|---|---|---|
| committer | Gabriel Hart | 2020-12-18 15:23:31 -0600 |
| commit | dbe0aaf636ccb78a3cc1281b6a1ea6c662af6756 (patch) | |
| tree | 59a05a2ba48af2a8c659946b74be50a5570e9ea3 /spaghetti-monster/fsm-pcint.c | |
| parent | added model number to Lume1 FW3X build target (diff) | |
| download | anduril-dbe0aaf636ccb78a3cc1281b6a1ea6c662af6756.tar.gz anduril-dbe0aaf636ccb78a3cc1281b6a1ea6c662af6756.tar.bz2 anduril-dbe0aaf636ccb78a3cc1281b6a1ea6c662af6756.zip | |
Add AVR 1-Series and t1616 board and scripts
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 |
