astyle with current project style guidelines

pull/389/head
Jesse Vincent 7 years ago
parent 1f8fc546e5
commit 5273b43ba0
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -20,33 +20,33 @@
#include <Kaleidoscope-LED-ActiveModColor.h> #include <Kaleidoscope-LED-ActiveModColor.h>
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_skip, Key_skip,
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_skip Key_skip
), ),
}; };
void setup () { void setup() {
Kaleidoscope.setup (KEYMAP_SIZE); Kaleidoscope.setup(KEYMAP_SIZE);
Kaleidoscope.use (&LEDControl, &ActiveModColorEffect, NULL); Kaleidoscope.use(&LEDControl, &ActiveModColorEffect, NULL);
ActiveModColorEffect.configure ({0x00, 0xff, 0xff}); ActiveModColorEffect.configure({0x00, 0xff, 0xff});
} }
void loop () { void loop() {
Kaleidoscope.loop (); Kaleidoscope.loop();
} }

@ -22,44 +22,44 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace LEDEffects { namespace LEDEffects {
cRGB ActiveModColorEffect::highlightColor = (cRGB) { cRGB ActiveModColorEffect::highlightColor = (cRGB) {
0xff, 0xff, 0xff 0xff, 0xff, 0xff
}; };
ActiveModColorEffect::ActiveModColorEffect (void) { ActiveModColorEffect::ActiveModColorEffect(void) {
} }
void void
ActiveModColorEffect::begin (void) { ActiveModColorEffect::begin(void) {
loop_hook_use (loopHook); loop_hook_use(loopHook);
} }
void void
ActiveModColorEffect::configure (const cRGB highlightColor_) { ActiveModColorEffect::configure(const cRGB highlightColor_) {
highlightColor = highlightColor_; highlightColor = highlightColor_;
} }
void void
ActiveModColorEffect::loopHook (bool postClear) { ActiveModColorEffect::loopHook(bool postClear) {
if (postClear) if (postClear)
return; return;
for (byte r = 0; r < ROWS; r++) { for (byte r = 0; r < ROWS; r++) {
for (byte c = 0; c < COLS; c++) { for (byte c = 0; c < COLS; c++) {
Key k = Layer.lookup (r, c); Key k = Layer.lookup(r, c);
if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) { if (k.raw >= KaleidoscopePlugins::Ranges::OSM_FIRST && k.raw <= KaleidoscopePlugins::Ranges::OSM_LAST) {
uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST; uint8_t idx = k.raw - KaleidoscopePlugins::Ranges::OSM_FIRST;
k.flags = 0; k.flags = 0;
k.keyCode = Key_LeftControl.keyCode + idx; k.keyCode = Key_LeftControl.keyCode + idx;
} }
if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw) if (k.raw < Key_LeftControl.raw || k.raw > Key_RightGui.raw)
continue; continue;
if (Keyboard.isModifierActive (k.keyCode)) if (Keyboard.isModifierActive(k.keyCode))
LEDControl.led_set_crgb_at (r, c, highlightColor); LEDControl.led_set_crgb_at(r, c, highlightColor);
}
} }
}
} }
}; };

@ -22,15 +22,15 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace LEDEffects { namespace LEDEffects {
class ActiveModColorEffect : public KaleidoscopePlugin { class ActiveModColorEffect : public KaleidoscopePlugin {
public: public:
ActiveModColorEffect (void); ActiveModColorEffect(void);
static void configure (const cRGB highlightColor); static void configure(const cRGB highlightColor);
virtual void begin (void) final; virtual void begin(void) final;
private: private:
static cRGB highlightColor; static cRGB highlightColor;
static void loopHook (bool postClear); static void loopHook(bool postClear);
}; };
}; };
}; };

Loading…
Cancel
Save