diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 6e88422b..e84c8079 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -63,12 +63,6 @@ #define LED1_PIN 2 #define LED1_PIN_INVERSE 1 - // Buttons - // No buttons on the D1 MINI alone, but defining it without adding a button doen't create problems - #define BUTTON1_PIN 0 // Connect a pushbutton between D3 and GND, - // it's the same as using a Wemos one button shield - #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH - #define BUTTON1_RELAY 1 // ----------------------------------------------------------------------------- // ESPurna diff --git a/code/espurna/light.ino b/code/espurna/light.ino index 835e4cc7..607548ef 100644 --- a/code/espurna/light.ino +++ b/code/espurna/light.ino @@ -205,7 +205,7 @@ unsigned int _toPWM(unsigned long value, bool bright, bool gamma, bool reverse) // Returns a PWM valule for the given channel ID unsigned int _toPWM(unsigned char id) { if (id < _channels.size()) { - bool isColor = (lightHasColor() && id < 3); + bool isColor = lightHasColor() && (id < 3); bool bright = isColor; bool gamma = isColor & (getSetting("useGamma", LIGHT_USE_GAMMA).toInt() == 1); return _toPWM(_channels[id].shadow, bright, gamma, _channels[id].reverse); @@ -227,7 +227,7 @@ void _shadow() { bool useWhite = getSetting("useWhite", LIGHT_USE_WHITE).toInt() == 1; - if (_lightState && useWhite && _channels.size() > 3) { + if (_lightState && useWhite && (_channels.size() > 3)) { if (_channels[0].shadow == _channels[1].shadow && _channels[1].shadow == _channels[2].shadow ) { _channels[3].shadow = _channels[0].shadow * ((float) _brightness / LIGHT_MAX_BRIGHTNESS); _channels[2].shadow = 0;