make astyle

pull/365/head
Jesse Vincent 8 years ago
parent 2b33266452
commit 3adb8c28af
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -19,24 +19,24 @@
#include <Kaleidoscope-LED-AlphaSquare.h>
namespace KaleidoscopePlugins {
namespace LEDEffects {
uint16_t AlphaSquareEffect::length = 1000;
uint32_t AlphaSquareEffect::endTimeLeft, AlphaSquareEffect::endTimeRight;
Key AlphaSquareEffect::lastKeyLeft, AlphaSquareEffect::lastKeyRight;
uint8_t AlphaSquareEffect::us;
namespace LEDEffects {
uint16_t AlphaSquareEffect::length = 1000;
uint32_t AlphaSquareEffect::endTimeLeft, AlphaSquareEffect::endTimeRight;
Key AlphaSquareEffect::lastKeyLeft, AlphaSquareEffect::lastKeyRight;
uint8_t AlphaSquareEffect::us;
AlphaSquareEffect::AlphaSquareEffect (void) {
}
AlphaSquareEffect::AlphaSquareEffect (void) {
}
void
AlphaSquareEffect::begin (void) {
void
AlphaSquareEffect::begin (void) {
Kaleidoscope.useEventHandlerHook (eventHandlerHook);
Kaleidoscope.use (&LEDControl, NULL);
us = LEDControl.mode_add (this);
}
}
void
AlphaSquareEffect::update (void) {
void
AlphaSquareEffect::update (void) {
if (endTimeLeft && millis () > endTimeLeft) {
::AlphaSquare.clear (lastKeyLeft);
endTimeLeft = 0;
@ -45,10 +45,10 @@ namespace KaleidoscopePlugins {
::AlphaSquare.clear (lastKeyRight, 10);
endTimeRight = 0;
}
}
}
Key
AlphaSquareEffect::eventHandlerHook (Key key, byte row, byte col, uint8_t keyState) {
Key
AlphaSquareEffect::eventHandlerHook (Key key, byte row, byte col, uint8_t keyState) {
if (LEDControl.get_mode () != us)
return key;
@ -78,8 +78,8 @@ namespace KaleidoscopePlugins {
::AlphaSquare.clear (prevKey, displayCol);
::AlphaSquare.display (key, displayCol);
return key;
}
};
}
};
};
KaleidoscopePlugins::LEDEffects::AlphaSquareEffect AlphaSquareEffect;

@ -22,8 +22,8 @@
#include <Kaleidoscope-LEDControl.h>
namespace KaleidoscopePlugins {
namespace LEDEffects {
class AlphaSquareEffect : public LEDMode {
namespace LEDEffects {
class AlphaSquareEffect : public LEDMode {
public:
AlphaSquareEffect (void);
@ -37,8 +37,8 @@ namespace KaleidoscopePlugins {
static uint8_t us;
static Key eventHandlerHook (Key key, uint8_t row, uint8_t col, uint8_t keyState);
};
};
};
};
};
extern KaleidoscopePlugins::LEDEffects::AlphaSquareEffect AlphaSquareEffect;

@ -21,11 +21,11 @@
#include <Kaleidoscope/LED-AlphaSquare.h>
namespace KaleidoscopePlugins {
namespace AlphaSquareSymbols {
/* λ */
static constexpr uint16_t Lambda = SYM4x4(1, 0, 0, 0,
namespace AlphaSquareSymbols {
/* λ */
static constexpr uint16_t Lambda = SYM4x4(1, 0, 0, 0,
0, 1, 0, 0,
0, 1, 1, 0,
1, 0, 0, 1);
};
};
};

@ -20,7 +20,7 @@
namespace KaleidoscopePlugins {
static const uint16_t alphabet[] PROGMEM = {
static const uint16_t alphabet[] PROGMEM = {
SYM4x4(1, 1, 1, 1,
1, 0, 0, 1,
1, 1, 1, 1,
@ -166,19 +166,19 @@ namespace KaleidoscopePlugins {
1, 0, 0, 1,
1, 0, 0, 1,
0, 1, 1, 0), // 0
};
};
cRGB AlphaSquare::color = {0x80, 0x80, 0x80};
cRGB AlphaSquare::color = {0x80, 0x80, 0x80};
AlphaSquare::AlphaSquare (void) {
}
AlphaSquare::AlphaSquare (void) {
}
void
AlphaSquare::begin (void) {
}
void
AlphaSquare::begin (void) {
}
void
AlphaSquare::display (Key key, uint8_t row, uint8_t col, cRGB keyColor) {
void
AlphaSquare::display (Key key, uint8_t row, uint8_t col, cRGB keyColor) {
if (key < Key_A || key > Key_0)
return;
@ -186,15 +186,15 @@ namespace KaleidoscopePlugins {
uint16_t symbol = pgm_read_word (&alphabet[index]);
display (symbol, row, col, keyColor);
}
}
void
AlphaSquare::display (Key key, uint8_t row, uint8_t col) {
void
AlphaSquare::display (Key key, uint8_t row, uint8_t col) {
display (key, row, col, color);
}
}
void
AlphaSquare::display (uint16_t symbol, uint8_t row, uint8_t col, cRGB keyColor) {
void
AlphaSquare::display (uint16_t symbol, uint8_t row, uint8_t col, cRGB keyColor) {
for (uint8_t r = 0; r < 4; r++) {
for (uint8_t c = 0; c < 4; c++) {
uint8_t pixel = bitRead (symbol, r * 4 + c);
@ -206,12 +206,12 @@ namespace KaleidoscopePlugins {
}
LEDControl.led_sync ();
}
}
void
AlphaSquare::display (uint16_t symbol, uint8_t row, uint8_t col) {
void
AlphaSquare::display (uint16_t symbol, uint8_t row, uint8_t col) {
display (symbol, row, col, color);
}
}
};
KaleidoscopePlugins::AlphaSquare AlphaSquare;

@ -35,7 +35,7 @@
)
namespace KaleidoscopePlugins {
class AlphaSquare : public KaleidoscopePlugin {
class AlphaSquare : public KaleidoscopePlugin {
public:
AlphaSquare (void);
@ -43,24 +43,44 @@ namespace KaleidoscopePlugins {
static void display (Key key, uint8_t row, uint8_t col, cRGB keyColor);
static void display (Key key, uint8_t row, uint8_t col);
static void display (Key key) { display (key, 0, 2); };
static void display (Key key, uint8_t col) { display (key, 0, col); };
static void display (Key key) {
display (key, 0, 2);
};
static void display (Key key, uint8_t col) {
display (key, 0, col);
};
static void display (uint16_t symbol, uint8_t row, uint8_t col, cRGB keyColor);
static void display (uint16_t symbol, uint8_t row, uint8_t col);
static void display (uint16_t symbol) { display (symbol, 0, 2); };
static void display (uint16_t symbol, uint8_t col) { display (symbol, 0, col); };
static void display (uint16_t symbol) {
display (symbol, 0, 2);
};
static void display (uint16_t symbol, uint8_t col) {
display (symbol, 0, col);
};
static void clear (Key key, uint8_t row, uint8_t col) { display (key, row, col, {0, 0, 0}); };
static void clear (Key key, uint8_t col) { clear (key, 0, col); };
static void clear (Key key) { clear (key, 0, 2); };
static void clear (Key key, uint8_t row, uint8_t col) {
display (key, row, col, {0, 0, 0});
};
static void clear (Key key, uint8_t col) {
clear (key, 0, col);
};
static void clear (Key key) {
clear (key, 0, 2);
};
static void clear (uint16_t symbol, uint8_t row, uint8_t col) { display (symbol, row, col, {0, 0, 0}); };
static void clear (uint16_t symbol, uint8_t col) { clear (symbol, 0, col); };
static void clear (uint16_t symbol) { clear (symbol, 0, 2); };
static void clear (uint16_t symbol, uint8_t row, uint8_t col) {
display (symbol, row, col, {0, 0, 0});
};
static void clear (uint16_t symbol, uint8_t col) {
clear (symbol, 0, col);
};
static void clear (uint16_t symbol) {
clear (symbol, 0, 2);
};
static cRGB color;
};
};
};
extern KaleidoscopePlugins::AlphaSquare AlphaSquare;

Loading…
Cancel
Save