astyle with current project style guidelines

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

@ -23,34 +23,34 @@
const Key keymaps[][ROWS][COLS] PROGMEM = {
[0] = KEYMAP_STACKED
(
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_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_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
Key_NoKey,
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_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_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl,
Key_NoKey
),
[0] = KEYMAP_STACKED
(
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_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_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift,
Key_NoKey,
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_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_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl,
Key_NoKey
),
};
void setup () {
Kaleidoscope.setup (KEYMAP_SIZE);
Kaleidoscope.use (&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL);
void setup() {
Kaleidoscope.setup(KEYMAP_SIZE);
Kaleidoscope.use(&LEDControl, &LEDOff, &MiamiEffect, &JukeboxEffect, &JukeboxAlternateEffect, NULL);
MiamiEffect.activate ();
MiamiEffect.activate();
}
void loop () {
Kaleidoscope.loop ();
void loop() {
Kaleidoscope.loop();
}

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

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

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

@ -24,16 +24,16 @@
namespace KaleidoscopePlugins {
namespace LEDEffects {
class TriColor : public LEDMode {
public:
TriColor (cRGB baseColor, cRGB modColor, cRGB escColor);
TriColor (cRGB baseColor, cRGB modColor) : TriColor (baseColor, modColor, modColor) {};
public:
TriColor(cRGB baseColor, cRGB modColor, cRGB escColor);
TriColor(cRGB baseColor, cRGB modColor) : TriColor(baseColor, modColor, modColor) {};
virtual void update (void) final;
virtual void update(void) final;
private:
cRGB baseColor;
cRGB modColor;
cRGB escColor;
private:
cRGB baseColor;
cRGB modColor;
cRGB escColor;
};
};
};

Loading…
Cancel
Save