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 @@ ...@@ -17,6 +17,7 @@
// Optional features // Optional features
#define BATTCHECK #define BATTCHECK
#define STROBE
#define LOW_VOLTAGE_PROTECTION #define LOW_VOLTAGE_PROTECTION
#include <avr/io.h> #include <avr/io.h>
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
#define TURBO_PRESSES 2 #define TURBO_PRESSES 2
#define BATTCHECK_PRESSES FIXED_SIZE+1 #define BATTCHECK_PRESSES FIXED_SIZE+1
#define STROBE_PRESSES FIXED_SIZE+2
#define CONFIG_PRESSES 10 #define CONFIG_PRESSES 10
/** /**
...@@ -78,6 +80,9 @@ enum State { ...@@ -78,6 +80,9 @@ enum State {
#ifdef BATTCHECK #ifdef BATTCHECK
kBattcheck, // Battery level kBattcheck, // Battery level
#endif // ifdef BATTCHECK #endif // ifdef BATTCHECK
#ifdef STROBE
kStrobe, // Strobe
#endif // ifdef STROBE
}; };
/** /**
...@@ -398,6 +403,12 @@ int main(void) { ...@@ -398,6 +403,12 @@ int main(void) {
break; break;
#endif // ifdef BATTCHECK #endif // ifdef BATTCHECK
#ifdef STROBE
case STROBE_PRESSES:
state = kStrobe;
break;
#endif // ifdef STROBE
case CONFIG_PRESSES: case CONFIG_PRESSES:
state = kConfig; state = kConfig;
break; break;
...@@ -420,6 +431,12 @@ int main(void) { ...@@ -420,6 +431,12 @@ int main(void) {
break; break;
#endif // ifdef BATTCHECK #endif // ifdef BATTCHECK
#ifdef STROBE
case STROBE_PRESSES:
state = kStrobe;
break;
#endif // ifdef STROBE
case CONFIG_PRESSES: case CONFIG_PRESSES:
state = kConfig; state = kConfig;
break; break;
...@@ -510,6 +527,13 @@ int main(void) { ...@@ -510,6 +527,13 @@ int main(void) {
break; break;
#endif // ifdef BATTCHECK #endif // ifdef BATTCHECK
#ifdef STROBE
case kStrobe:
set_pwm(TURBO_PWM);
blink(1, 4);
break;
#endif // ifdef STROBE
case kConfig: case kConfig:
disable_output(); disable_output();
set_pwm(FLASH_PWM); 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