Merge pull request #49 from algernon/f/LED/off-effect

Explicit LED Off effect
pull/53/head
Jesse Vincent 8 years ago committed by GitHub
commit 8aaabc229b

@ -7,7 +7,8 @@
#include "KeyboardioFirmware.h" #include "KeyboardioFirmware.h"
#include "generated/keymaps.h" #include "generated/keymaps.h"
#include "LED-BootAnimation.h" #include "BootAnimation.h"
#include "LED-Off.h"
#include "LED-SolidColor.h" #include "LED-SolidColor.h"
#include "LED-Numlock.h" #include "LED-Numlock.h"
#include "LED-BreatheEffect.h" #include "LED-BreatheEffect.h"
@ -23,7 +24,7 @@ uint8_t temporary_keymap = 0;
const Key keymaps[][ROWS][COLS] PROGMEM = { KEYMAP_LIST }; const Key keymaps[][ROWS][COLS] PROGMEM = { KEYMAP_LIST };
static LEDBootAnimation bootAnimation; static LEDOff LEDSOff;
static LEDSolidColor solidRed (100, 0, 0); static LEDSolidColor solidRed (100, 0, 0);
static LEDSolidColor solidOrange (100, 30, 0); static LEDSolidColor solidOrange (100, 30, 0);
static LEDSolidColor solidYellow (90, 70, 0); static LEDSolidColor solidYellow (90, 70, 0);
@ -41,6 +42,7 @@ static LEDNumlock numLockEffect (NUMPAD_KEYMAP);
void setup() { void setup() {
Keyboardio.setup(KEYMAPS); Keyboardio.setup(KEYMAPS);
bootAnimation();
} }

@ -1,4 +1,8 @@
#include "LED-BootAnimation.h" #include "BootAnimation.h"
#include "KeyboardConfig.h"
#include "EEPROM.h"
#define EEPROM_BOOT_ANIMATION_LOCATION 1
static void static void
type_letter(uint8_t letter) { type_letter(uint8_t letter) {
@ -10,12 +14,11 @@ type_letter(uint8_t letter) {
delay(10); delay(10);
} }
LEDBootAnimation::LEDBootAnimation (void) {
LEDControl.mode_add (this);
}
void void
LEDBootAnimation::setup (void) { bootAnimation (void) {
if (EEPROM.read (EEPROM_BOOT_ANIMATION_LOCATION))
return;
LEDControl.set_all_leds_to(0, 0, 0); LEDControl.set_all_leds_to(0, 0, 0);
type_letter(LED_K); type_letter(LED_K);
@ -32,4 +35,6 @@ LEDBootAnimation::setup (void) {
type_letter(LED_0); type_letter(LED_0);
type_letter(LED_PERIOD); type_letter(LED_PERIOD);
type_letter(LED_9); type_letter(LED_9);
EEPROM.update (EEPROM_BOOT_ANIMATION_LOCATION, 1);
} }

@ -0,0 +1,3 @@
#pragma once
void bootAnimation(void);

@ -1,10 +0,0 @@
#pragma once
#include "LEDControl.h"
class LEDBootAnimation : LEDMode {
public:
LEDBootAnimation (void);
virtual void setup (void) final;
};

@ -0,0 +1,8 @@
#pragma once
#include "LEDControl.h"
class LEDOff : LEDMode {
public:
LEDOff (void) { LEDControl.mode_add (this); };
};
Loading…
Cancel
Save