make astyle

pull/389/head
Jesse Vincent 8 years ago
parent 07e19a5432
commit e1fd94e4ff
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -23,34 +23,34 @@
const Key keymaps[][ROWS][COLS] PROGMEM = { const Key keymaps[][ROWS][COLS] PROGMEM = {
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
( (
Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext, Key_LEDEffectNext, Key_1, Key_2, Key_3, Key_4, Key_5, Key_LEDEffectNext,
Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab,
Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G,
Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape,
Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
Key_NoKey, Key_NoKey,
Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip,
Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals,
Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote,
Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus,
Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl,
Key_NoKey Key_NoKey
), ),
}; };
void setup () { void setup () {
Kaleidoscope.setup (KEYMAP_SIZE); Kaleidoscope.setup (KEYMAP_SIZE);
Kaleidoscope.use (&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL); Kaleidoscope.use (&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL);
MiamiEffect.activate (); MiamiEffect.activate ();
} }
void loop () { void loop () {
Kaleidoscope.loop (); Kaleidoscope.loop ();
} }

@ -18,10 +18,22 @@
#include <Kaleidoscope-LEDEffects.h> #include <Kaleidoscope-LEDEffects.h>
KaleidoscopePlugins::LEDEffects::TriColor JukeboxEffect((cRGB){0xc8, 0xe8, 0xee} /* TM */, KaleidoscopePlugins::LEDEffects::TriColor JukeboxEffect((cRGB) {
(cRGB){0xc3, 0xee, 0x8c} /* VCO */, 0xc8, 0xe8, 0xee
(cRGB){0x21, 0x38, 0xd7} /* RN */); } /* TM */,
(cRGB) {
0xc3, 0xee, 0x8c
} /* VCO */,
(cRGB) {
0x21, 0x38, 0xd7
} /* RN */);
KaleidoscopePlugins::LEDEffects::TriColor JukeboxAlternateEffect((cRGB){0xc8, 0xe8, 0xee} /* TM */, KaleidoscopePlugins::LEDEffects::TriColor JukeboxAlternateEffect((cRGB) {
(cRGB){0x21, 0x38, 0xd7} /* RN */, 0xc8, 0xe8, 0xee
(cRGB){0xc3, 0xee, 0x8c} /* VCO */); } /* TM */,
(cRGB) {
0x21, 0x38, 0xd7
} /* RN */,
(cRGB) {
0xc3, 0xee, 0x8c
} /* VCO */);

@ -18,5 +18,9 @@
#include <Kaleidoscope-LEDEffects.h> #include <Kaleidoscope-LEDEffects.h>
KaleidoscopePlugins::LEDEffects::TriColor MiamiEffect((cRGB){0xd6, 0xd6, 0x4e} /* Cyan */, KaleidoscopePlugins::LEDEffects::TriColor MiamiEffect((cRGB) {
(cRGB){0xaf, 0x67, 0xfa} /* Magenta */); 0xd6, 0xd6, 0x4e
} /* Cyan */,
(cRGB) {
0xaf, 0x67, 0xfa
} /* Magenta */);

@ -19,45 +19,45 @@
#include <Kaleidoscope-LEDEffects.h> #include <Kaleidoscope-LEDEffects.h>
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace LEDEffects { namespace LEDEffects {
TriColor::TriColor (cRGB baseColor, cRGB modColor, cRGB escColor) { TriColor::TriColor (cRGB baseColor, cRGB modColor, cRGB escColor) {
this->baseColor = baseColor; this->baseColor = baseColor;
this->modColor = modColor; this->modColor = modColor;
this->escColor = escColor; this->escColor = escColor;
} }
void void
TriColor::update (void) { TriColor::update (void) {
for (uint8_t r = 0; r < ROWS; r++) { for (uint8_t r = 0; r < ROWS; r++) {
for (uint8_t c = 0; c < COLS; c++) { for (uint8_t c = 0; c < COLS; c++) {
Key k = Layer.lookup (r, c); Key k = Layer.lookup (r, c);
// Special keys are always modColor // Special keys are always modColor
if (k.flags != 0) { if (k.flags != 0) {
LEDControl.led_set_crgb_at (r, c, modColor); LEDControl.led_set_crgb_at (r, c, modColor);
continue; continue;
} }
cRGB color = modColor; cRGB color = modColor;
switch (k.keyCode) { switch (k.keyCode) {
case Key_A.keyCode ... Key_0.keyCode: case Key_A.keyCode ... Key_0.keyCode:
case Key_Spacebar.keyCode: case Key_Spacebar.keyCode:
case Key_KeypadSubtract.keyCode ... Key_KeypadDivide.keyCode: case Key_KeypadSubtract.keyCode ... Key_KeypadDivide.keyCode:
case Key_Keypad1.keyCode ... Key_KeypadDot.keyCode: case Key_Keypad1.keyCode ... Key_KeypadDot.keyCode:
case Key_F1.keyCode ... Key_F4.keyCode: case Key_F1.keyCode ... Key_F4.keyCode:
case Key_F9.keyCode ... Key_F12.keyCode: case Key_F9.keyCode ... Key_F12.keyCode:
color = baseColor; color = baseColor;
break; break;
case Key_Escape.keyCode: case Key_Escape.keyCode:
color = escColor; color = escColor;
break; break;
} }
LEDControl.led_set_crgb_at (r, c, color); LEDControl.led_set_crgb_at (r, c, color);
} }
}
} }
}; }
};
}; };

@ -22,18 +22,18 @@
#include <Kaleidoscope-LEDControl.h> #include <Kaleidoscope-LEDControl.h>
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace LEDEffects { namespace LEDEffects {
class TriColor : public LEDMode { class TriColor : public LEDMode {
public: public:
TriColor (cRGB baseColor, cRGB modColor, cRGB escColor); TriColor (cRGB baseColor, cRGB modColor, cRGB escColor);
TriColor (cRGB baseColor, cRGB modColor) : TriColor (baseColor, modColor, modColor) {}; TriColor (cRGB baseColor, cRGB modColor) : TriColor (baseColor, modColor, modColor) {};
virtual void update (void) final; virtual void update (void) final;
private: private:
cRGB baseColor; cRGB baseColor;
cRGB modColor; cRGB modColor;
cRGB escColor; cRGB escColor;
}; };
}; };
}; };

Loading…
Cancel
Save