make astyle

pull/28/head
Jesse Vincent 8 years ago
parent 5e843dc9cd
commit a5f3b98c79

@ -2,48 +2,48 @@
#include "TestMode.h"
void TestMode_::TestLEDs(void) {
// make all LEDs dim red
LEDControl.set_all_leds_to(50,0,0);
led_sync();
delay(1000);
// make all LEDs dim blue
LEDControl.set_all_leds_to(0,50,0);
led_sync();
delay(1000);
// make all LEDs dim green
LEDControl.set_all_leds_to(0,0,50);
led_sync();
delay(1000);
// make all LEDs dim white
LEDControl.set_all_leds_to(50,50,50);
led_sync();
delay(1000);
// make all the LEDs bright red
LEDControl.set_all_leds_to(200,0,0);
led_sync();
delay(1000);
// make all the LEDs bright green
LEDControl.set_all_leds_to(0,200,0);
led_sync();
delay(1000);
// make all the LEDs bright blue
LEDControl.set_all_leds_to(0,0,200);
led_sync();
delay(1000);
// make all the LEDs bright white (1.6A)
LEDControl.set_all_leds_to(160,160,160);
led_sync();
delay(1000);
// rainbow for 10 seconds
for(auto i=0; i<10000;i++ ) {
LEDControl.effect_rainbow_update();
led_sync();
delay(1);
}
// set all the keys to red
LEDControl.set_all_leds_to(50,0,0);
// make all LEDs dim blue
// as you hit each key, set it to blue
// as you hit each key a second time, set it to green
// as you hit each key a third time, set it to off
// make all LEDs dim red
LEDControl.set_all_leds_to(50,0,0);
led_sync();
delay(1000);
// make all LEDs dim blue
LEDControl.set_all_leds_to(0,50,0);
led_sync();
delay(1000);
// make all LEDs dim green
LEDControl.set_all_leds_to(0,0,50);
led_sync();
delay(1000);
// make all LEDs dim white
LEDControl.set_all_leds_to(50,50,50);
led_sync();
delay(1000);
// make all the LEDs bright red
LEDControl.set_all_leds_to(200,0,0);
led_sync();
delay(1000);
// make all the LEDs bright green
LEDControl.set_all_leds_to(0,200,0);
led_sync();
delay(1000);
// make all the LEDs bright blue
LEDControl.set_all_leds_to(0,0,200);
led_sync();
delay(1000);
// make all the LEDs bright white (1.6A)
LEDControl.set_all_leds_to(160,160,160);
led_sync();
delay(1000);
// rainbow for 10 seconds
for(auto i=0; i<10000; i++ ) {
LEDControl.effect_rainbow_update();
led_sync();
delay(1);
}
// set all the keys to red
LEDControl.set_all_leds_to(50,0,0);
// make all LEDs dim blue
// as you hit each key, set it to blue
// as you hit each key a second time, set it to green
// as you hit each key a third time, set it to off
}

@ -1,11 +1,11 @@
class TestMode_ {
public:
public:
void start();
void start();
private:
private:
void TestLEDs();
void TestKeys();
void TestOneKey();
void TestLEDs();
void TestKeys();
void TestOneKey();
};

@ -5,8 +5,8 @@
typedef union {
struct {
uint8_t flags;
uint8_t rawKey;
uint8_t flags;
uint8_t rawKey;
};
uint16_t raw;
} Key;

@ -43,8 +43,8 @@ void handle_synthetic_key_event(Key mappedKey, uint8_t currentState, uint8_t pre
__attribute__((weak))
custom_handler_t eventHandlers[] = {
handle_key_event_default,
(custom_handler_t) NULL
handle_key_event_default,
(custom_handler_t) NULL
};
Key lookup_key(byte keymap, byte row, byte col) {
@ -57,9 +57,9 @@ Key lookup_key(byte keymap, byte row, byte col) {
void handle_key_event(byte row, byte col, uint8_t currentState, uint8_t previousState) {
for (byte i = 0; eventHandlers[i] != NULL; i++) {
custom_handler_t handler = eventHandlers[i];
if ((*handler)(row, col, currentState, previousState))
return;
custom_handler_t handler = eventHandlers[i];
if ((*handler)(row, col, currentState, previousState))
return;
}
}

Loading…
Cancel
Save