TriColor: Remove a useless optimisation

Do not store the previous layer state, and instead of updating only when
the layer changes, just update anyway. It's not that costy anymore, with
the recent `Layer.lookup` optimisations.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 02cb499154
commit 14e03cd598

@ -25,16 +25,10 @@ namespace KaleidoscopePlugins {
this->baseColor = baseColor;
this->modColor = modColor;
this->escColor = escColor;
previousLayerState = 0xffffffff;
}
void
TriColor::update (void) {
uint8_t layerState = Layer.getLayerState ();
if (previousLayerState == layerState)
return;
previousLayerState = layerState;
for (uint8_t r = 0; r < ROWS; r++) {
for (uint8_t c = 0; c < COLS; c++) {
Key k = Layer.lookup (r, c);

@ -31,7 +31,6 @@ namespace KaleidoscopePlugins {
virtual void update (void) final;
private:
uint32_t previousLayerState;
cRGB baseColor;
cRGB modColor;
cRGB escColor;

Loading…
Cancel
Save