make astyle

pull/389/head
Jesse Vincent 8 years ago
parent 9dcb132dbe
commit 517636d479
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -23,24 +23,24 @@
namespace KaleidoscopePlugins {
uint16_t EEPROMColormapEffect::paletteBase;
uint16_t EEPROMColormapEffect::mapBase;
uint8_t EEPROMColormapEffect::maxLayers;
uint16_t EEPROMColormapEffect::paletteBase;
uint16_t EEPROMColormapEffect::mapBase;
uint8_t EEPROMColormapEffect::maxLayers;
EEPROMColormapEffect::EEPROMColormapEffect (void) {
}
EEPROMColormapEffect::EEPROMColormapEffect (void) {
}
void
EEPROMColormapEffect::configure (uint8_t maxLayers_) {
void
EEPROMColormapEffect::configure (uint8_t maxLayers_) {
USE_PLUGINS (&::EEPROMSettings);
maxLayers = maxLayers_;
paletteBase = ::EEPROMSettings.requestSlice (15 * sizeof (cRGB));
mapBase = ::EEPROMSettings.requestSlice (maxLayers * ROWS * COLS / 2);
}
}
void
EEPROMColormapEffect::update (void) {
void
EEPROMColormapEffect::update (void) {
for (uint8_t l = 0; l < 32; l++) {
if (!Layer.isOn (l))
continue;
@ -56,10 +56,10 @@ namespace KaleidoscopePlugins {
}
}
}
}
}
const bool
EEPROMColormapEffect::lookupColor (uint8_t layer, uint8_t row, uint8_t column, cRGB *color) {
const bool
EEPROMColormapEffect::lookupColor (uint8_t layer, uint8_t row, uint8_t column, cRGB *color) {
uint8_t colorIndex;
uint16_t mapIndex = (layer * ROWS * COLS / 2 + row * COLS / 2 + column / 2);
@ -75,10 +75,10 @@ namespace KaleidoscopePlugins {
EEPROM.get (paletteBase + colorIndex * sizeof (cRGB), *color);
return true;
}
}
bool
EEPROMColormapEffect::focusHook (const char *command) {
bool
EEPROMColormapEffect::focusHook (const char *command) {
enum {
PALETTE,
MAP,
@ -94,8 +94,7 @@ namespace KaleidoscopePlugins {
return false;
switch (subCommand) {
case PALETTE:
{
case PALETTE: {
if (Serial.peek () == '\n') {
for (uint8_t i = 0; i < 15; i++) {
cRGB color;
@ -123,8 +122,7 @@ namespace KaleidoscopePlugins {
break;
}
case MAP:
{
case MAP: {
if (Serial.peek () == '\n') {
for (uint8_t layer = 0; layer < maxLayers; layer++) {
for (uint8_t row = 0; row < ROWS; row++) {
@ -153,7 +151,7 @@ namespace KaleidoscopePlugins {
uint8_t idx2 = Serial.parseInt ();
uint8_t indexes = (idx1 << 4) + idx2;
EEPROM.update (mapBase + loc , indexes);
EEPROM.update (mapBase + loc, indexes);
loc++;
}
break;
@ -161,7 +159,7 @@ namespace KaleidoscopePlugins {
}
return true;
}
}
};

@ -21,7 +21,7 @@
#include <Kaleidoscope-LEDControl.h>
namespace KaleidoscopePlugins {
class EEPROMColormapEffect : public LEDMode {
class EEPROMColormapEffect : public LEDMode {
public:
static const uint8_t Transparent = 15;
@ -37,7 +37,7 @@ namespace KaleidoscopePlugins {
static uint8_t maxLayers;
static uint16_t paletteBase;
static uint16_t mapBase;
};
};
};
extern KaleidoscopePlugins::EEPROMColormapEffect EEPROMColormapEffect;

Loading…
Cancel
Save