make astyle

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

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

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

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

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

Loading…
Cancel
Save