Skip to content

Commit

Permalink
add low intensity (off) LED flasher sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
wertarbyte committed Sep 17, 2012
1 parent 9ef116b commit 69efe60
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
32 changes: 21 additions & 11 deletions Alarms.ino
Expand Up @@ -365,22 +365,32 @@ void blinkLED(uint8_t num, uint8_t ontime,uint8_t repeat) {
*/
void led_flasher_autoselect_sequence() {
if (led_flasher_control != LED_FLASHER_AUTO) return;

#if defined(LED_FLASHER_SEQUENCE_MAX)
/* do we want the complete illumination no questions asked? */
if (rcOptions[BOXLEDMAX]) {
#else
if (0) {
#endif
led_flasher_set_sequence(LED_FLASHER_SEQUENCE_MAX);
} else {
/* do we have a special sequence for armed copters? */
#if defined(LED_FLASHER_SEQUENCE_ARMED)
led_flasher_set_sequence(f.ARMED ? LED_FLASHER_SEQUENCE_ARMED : LED_FLASHER_SEQUENCE);
#else
/* Let's load the plain old boring sequence */
led_flasher_set_sequence(LED_FLASHER_SEQUENCE);
#endif
return;
}
#endif

#if defined(LED_FLASHER_SEQUENCE_LOW)
if (rcOptions[BOXLEDLOW]) {
led_flasher_set_sequence(LED_FLASHER_SEQUENCE_LOW);
return;
}
#endif

#if defined(LED_FLASHER_SEQUENCE_ARMED)
/* do we have a special sequence for armed copters? */
if (f.ARMED) {
led_flasher_set_sequence(LED_FLASHER_SEQUENCE_ARMED);
return;
}
#endif

/* Let's load the plain old boring sequence as a last resort */
led_flasher_set_sequence(LED_FLASHER_SEQUENCE);
}

#endif
Expand Down
2 changes: 2 additions & 0 deletions MultiWii.ino
Expand Up @@ -77,6 +77,7 @@ enum box {
#endif
#if defined(LED_FLASHER)
BOXLEDMAX, // we want maximum illumination
BOXLEDLOW, // low/no lights
#endif
#if defined(LANDING_LIGHTS_DDR)
BOXLLIGHTS, // enable landing lights at any altitude
Expand Down Expand Up @@ -120,6 +121,7 @@ const char boxnames[] PROGMEM = // names for dynamic generation of config GUI
#endif
#if defined(LED_FLASHER)
"LEDMAX;"
"LEDLOW;"
#endif
#if defined(LANDING_LIGHTS_DDR)
"LLIGHTS;"
Expand Down
1 change: 1 addition & 0 deletions config.h
Expand Up @@ -552,6 +552,7 @@
//#define LED_FLASHER_SEQUENCE 0b00000000 // leds OFF
//#define LED_FLASHER_SEQUENCE_ARMED 0b00000101 // create double flashes
//#define LED_FLASHER_SEQUENCE_MAX 0b11111111 // full illumination
//#define LED_FLASHER_SEQUENCE_LOW 0b00000000 // no illumination


/******************************* Landing lights *********************************/
Expand Down

0 comments on commit 69efe60

Please sign in to comment.