Commit 082f9bfa authored by Sven Greiner's avatar Sven Greiner

Add simple 8 Hz strobe mode

8 Hz results in another compiler optimization using 8 bytes less than
other frequencies.

See #2
parent 619e2f67
......@@ -17,6 +17,7 @@
// Optional features
#define BATTCHECK
#define STROBE
#define LOW_VOLTAGE_PROTECTION
#include <avr/io.h>
......@@ -55,6 +56,7 @@
#define TURBO_PRESSES 2
#define BATTCHECK_PRESSES FIXED_SIZE+1
#define STROBE_PRESSES FIXED_SIZE+2
#define CONFIG_PRESSES 10
/**
......@@ -78,6 +80,9 @@ enum State {
#ifdef BATTCHECK
kBattcheck, // Battery level
#endif // ifdef BATTCHECK
#ifdef STROBE
kStrobe, // Strobe
#endif // ifdef STROBE
};
/**
......@@ -398,6 +403,12 @@ int main(void) {
break;
#endif // ifdef BATTCHECK
#ifdef STROBE
case STROBE_PRESSES:
state = kStrobe;
break;
#endif // ifdef STROBE
case CONFIG_PRESSES:
state = kConfig;
break;
......@@ -420,6 +431,12 @@ int main(void) {
break;
#endif // ifdef BATTCHECK
#ifdef STROBE
case STROBE_PRESSES:
state = kStrobe;
break;
#endif // ifdef STROBE
case CONFIG_PRESSES:
state = kConfig;
break;
......@@ -510,6 +527,13 @@ int main(void) {
break;
#endif // ifdef BATTCHECK
#ifdef STROBE
case kStrobe:
set_pwm(TURBO_PWM);
blink(1, 4);
break;
#endif // ifdef STROBE
case kConfig:
disable_output();
set_pwm(FLASH_PWM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment