astyle with current project style guidelines

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

@ -40,13 +40,13 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
), ),
}; };
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();
} }

@ -25,27 +25,27 @@ 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;
@ -56,8 +56,8 @@ ActiveModColorEffect::loopHook (bool postClear) {
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);
} }
} }
} }

@ -23,14 +23,14 @@ 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