aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-main.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-11-20 15:33:43 -0700
committerSelene ToyKeeper2019-11-20 15:33:43 -0700
commit10bd9162c3033f993b98e3c5b96cb95b9205d20e (patch)
treeeded168b91976d43e4f4c15355767646aa2c8653 /spaghetti-monster/fsm-main.c
parentmerged fsm updates / irq-refactor branch, to get more stable voltage readings (diff)
parentmerged tiny fix from irq-refactor branch (fixed spurious wakeup) (diff)
downloadanduril-10bd9162c3033f993b98e3c5b96cb95b9205d20e.tar.gz
anduril-10bd9162c3033f993b98e3c5b96cb95b9205d20e.tar.bz2
anduril-10bd9162c3033f993b98e3c5b96cb95b9205d20e.zip
merged more updates from fsm / irq-refactor branches, finishing up previous changes
Diffstat (limited to 'spaghetti-monster/fsm-main.c')
-rw-r--r--spaghetti-monster/fsm-main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/spaghetti-monster/fsm-main.c b/spaghetti-monster/fsm-main.c
index c9ab69b..4ad1e16 100644
--- a/spaghetti-monster/fsm-main.c
+++ b/spaghetti-monster/fsm-main.c
@@ -37,7 +37,7 @@ ISR(TIMER1_COMPA_vect) {
#endif
#if (ATTINY == 25) || (ATTINY == 45) || (ATTINY == 85)
-inline void hw_setup() {
+static inline void hw_setup() {
// configure PWM channels
#if PWM_CHANNELS >= 1
DDRB |= (1 << PWM1_PIN);
@@ -69,7 +69,7 @@ inline void hw_setup() {
PCMSK = (1 << SWITCH_PIN); // pin change interrupt uses this pin
}
#elif (ATTINY == 1634)
-inline void hw_setup() {
+static inline void hw_setup() {
// this gets tricky with so many pins...
// ... so punt it to the hwdef file
hwdef_setup();
@@ -79,22 +79,24 @@ inline void hw_setup() {
#endif
-#ifdef USE_REBOOT
-void prevent_reboot_loop() {
+//#ifdef USE_REBOOT
+static inline void prevent_reboot_loop() {
// prevent WDT from rebooting MCU again
MCUSR &= ~(1<<WDRF); // reset status flag
wdt_disable();
}
-#endif
+//#endif
int main() {
// Don't allow interrupts while booting
cli();
- #ifdef USE_REBOOT
+ //#ifdef USE_REBOOT
+ // prevents cycling after a crash,
+ // whether intentional (like factory reset) or not (bugs)
prevent_reboot_loop();
- #endif
+ //#endif
hw_setup();