aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-04-01 18:37:31 -0600
committerSelene ToyKeeper2021-04-01 18:37:31 -0600
commit15adc384caf1db3311a6ccd684a3dcf3757606cf (patch)
treeb05ef9746478d3c0a8bf471c29e9e44d8b159a6f
parenttouched up a bit of formatting and a note for later optimization (diff)
downloadanduril-15adc384caf1db3311a6ccd684a3dcf3757606cf.tar.gz
anduril-15adc384caf1db3311a6ccd684a3dcf3757606cf.tar.bz2
anduril-15adc384caf1db3311a6ccd684a3dcf3757606cf.zip
slightly reorganized declaration of PCINT to make it easier to read
-rw-r--r--spaghetti-monster/fsm-pcint.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/spaghetti-monster/fsm-pcint.c b/spaghetti-monster/fsm-pcint.c
index 4a3c193..4ada5b8 100644
--- a/spaghetti-monster/fsm-pcint.c
+++ b/spaghetti-monster/fsm-pcint.c
@@ -69,24 +69,20 @@ inline void PCINT_off() {
//void button_change_interrupt() {
#if (ATTINY == 25) || (ATTINY == 45) || (ATTINY == 85) || (ATTINY == 1634)
-//EMPTY_INTERRUPT(PCINT0_vect);
-#ifdef PCINT_vect
-ISR(PCINT_vect) {
-#else
-ISR(PCINT0_vect) {
-#endif
- irq_pcint = 1;
-}
+ #ifdef PCINT_vect
+ ISR(PCINT_vect) {
+ #else
+ ISR(PCINT0_vect) {
+ #endif
#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;
-}
+ ISR(SWITCH_VECT) {
+ // Write a '1' to clear the interrupt flag
+ SWITCH_INTFLG |= (1 << SWITCH_PIN);
#else
#error Unrecognized MCU type
#endif
-/*
-ISR(PCINT0_vect) {
+
+ irq_pcint = 1; // let deferred code know an interrupt happened
//DEBUG_FLASH;
@@ -95,9 +91,7 @@ ISR(PCINT0_vect) {
// noisy / bouncy switch (so the content of this function has been
// moved to a separate function, called from WDT only)
// PCINT_inner(button_is_pressed());
-
}
-*/
// should only be called from PCINT and/or WDT
// (is a separate function to reduce code duplication)