astyle with current project style guidelines

pull/365/head
Jesse Vincent 8 years ago
parent ca71ff2c75
commit 18fe127ac2
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -10,59 +10,59 @@ byte NumLock_::row = 255, NumLock_::col = 255;
cRGB numpad_color; cRGB numpad_color;
NumLock_::NumLock_ (void) { NumLock_::NumLock_(void) {
} }
void void
NumLock_::begin (void) { NumLock_::begin(void) {
us = LEDControl.mode_add (this); us = LEDControl.mode_add(this);
numpad_color.r=255; numpad_color.r=255;
} }
void void
NumLock_::init (void) { NumLock_::init(void) {
if (!isActive) { if (!isActive) {
LEDControl.next_mode(); LEDControl.next_mode();
} }
} }
void void
NumLock_::update (void) { NumLock_::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);
if (k.raw < Key_KeypadNumLock.raw || k.raw > Key_KeypadDot.raw) if (k.raw < Key_KeypadNumLock.raw || k.raw > Key_KeypadDot.raw)
continue; continue;
LEDControl.led_set_crgb_at(r, c, numpad_color); LEDControl.led_set_crgb_at(r, c, numpad_color);
}
} }
}
if (row > ROWS || col > COLS) if (row > ROWS || col > COLS)
return; return;
cRGB color = breath_compute(); cRGB color = breath_compute();
LEDControl.led_set_crgb_at (row, col, color); LEDControl.led_set_crgb_at(row, col, color);
} }
const macro_t * const macro_t *
NumLock_::toggle (byte row_, byte col_, uint8_t numPadLayer) { NumLock_::toggle(byte row_, byte col_, uint8_t numPadLayer) {
row = row_; row = row_;
col = col_; col = col_;
if (Layer.isOn (numPadLayer)) { if (Layer.isOn(numPadLayer)) {
isActive = false; isActive = false;
LEDControl.set_mode (previousLEDMode); LEDControl.set_mode(previousLEDMode);
Layer.off (numPadLayer); Layer.off(numPadLayer);
} else { } else {
isActive = true; isActive = true;
previousLEDMode = LEDControl.get_mode (); previousLEDMode = LEDControl.get_mode();
LEDControl.set_mode (us); LEDControl.set_mode(us);
Layer.on (numPadLayer); Layer.on(numPadLayer);
} }
return MACRO(T(KeypadNumLock), END); return MACRO(T(KeypadNumLock), END);
} }
NumLock_ NumLock; NumLock_ NumLock;

@ -9,14 +9,14 @@
class NumLock_ : public LEDMode { class NumLock_ : public LEDMode {
public: public:
NumLock_ (void); NumLock_(void);
virtual void begin (void) final; virtual void begin(void) final;
virtual void update (void) final; virtual void update(void) final;
virtual void init (void) final; virtual void init(void) final;
static const macro_t *toggle (byte row, byte col, uint8_t numPadLayer); static const macro_t *toggle(byte row, byte col, uint8_t numPadLayer);
private: private:
static uint8_t previousLEDMode; static uint8_t previousLEDMode;

Loading…
Cancel
Save