Commit de750863 authored by Sven Greiner's avatar Sven Greiner

Add beacon mode

parent 9bfbc8e0
......@@ -17,6 +17,7 @@
// Optional features
#define BATTCHECK
#define BEACON
#define LOW_VOLTAGE_PROTECTION
#include <avr/io.h>
......@@ -55,6 +56,7 @@
#define TURBO_PRESSES 2
#define BATTCHECK_PRESSES FIXED_SIZE+1
#define BEACON_PRESSES FIXED_SIZE+2
#define CONFIG_PRESSES 10
/**
......@@ -78,6 +80,9 @@ enum State {
#ifdef BATTCHECK
kBattcheck, // Battery level
#endif // ifdef BATTCHECK
#ifdef BEACON
kBeacon, // Beacon
#endif // ifdef BEACON
};
/**
......@@ -403,6 +408,12 @@ int main(void) {
break;
#endif // ifdef BATTCHECK
#ifdef BEACON
case BEACON_PRESSES:
state = kBeacon;
break;
#endif // ifdef BEACON
case CONFIG_PRESSES:
state = kConfig;
break;
......@@ -503,6 +514,16 @@ int main(void) {
break;
#endif // ifdef BATTCHECK
#ifdef BEACON
case kBeacon:
set_pwm(TURBO_PWM);
blink(2, 3);
set_level(1);
delay_s();
delay_s();
break;
#endif // ifdef BEACON
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