diff options
Diffstat (limited to 'spaghetti-monster/fsm-standby.h')
| -rw-r--r-- | spaghetti-monster/fsm-standby.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/spaghetti-monster/fsm-standby.h b/spaghetti-monster/fsm-standby.h index 2cea080..9f411be 100644 --- a/spaghetti-monster/fsm-standby.h +++ b/spaghetti-monster/fsm-standby.h @@ -27,15 +27,15 @@ volatile uint8_t go_to_standby = 0; #ifdef TICK_DURING_STANDBY #ifndef STANDBY_TICK_SPEED -#define STANDBY_TICK_SPEED 5 // every 0.512 s +#define STANDBY_TICK_SPEED 3 // every 0.128 s /* * From the Attiny85 manual: * 0: 16 ms * 1: 32 ms * 2: 64 ms - * 3: 0.125 s - * 4: 0.25 s - * 5: 0.5 s + * 3: 0.128 s + * 4: 0.256 s + * 5: 0.512 s * 6: 1.0 s * 7: 2.0 s * 32: 4.0 s @@ -45,6 +45,19 @@ volatile uint8_t go_to_standby = 0; * how it is) */ #endif +#if (STANDBY_TICK_SPEED == 1) +#define SLEEP_TICKS_PER_SECOND 31 +#elif (STANDBY_TICK_SPEED == 2) +#define SLEEP_TICKS_PER_SECOND 16 +#elif (STANDBY_TICK_SPEED == 3) +#define SLEEP_TICKS_PER_SECOND 8 +#elif (STANDBY_TICK_SPEED == 4) +#define SLEEP_TICKS_PER_SECOND 4 +#elif (STANDBY_TICK_SPEED == 5) +#define SLEEP_TICKS_PER_SECOND 2 +#elif (STANDBY_TICK_SPEED == 6) +#define SLEEP_TICKS_PER_SECOND 1 +#endif #endif #define standby_mode sleep_until_eswitch_pressed |
