Browse Source

Clean up

fastled
Xose Pérez 7 years ago
parent
commit
bd5d997c25
2 changed files with 2 additions and 8 deletions
  1. +0
    -6
      code/espurna/config/hardware.h
  2. +2
    -2
      code/espurna/light.ino

+ 0
- 6
code/espurna/config/hardware.h View File

@ -63,12 +63,6 @@
#define LED1_PIN 2 #define LED1_PIN 2
#define LED1_PIN_INVERSE 1 #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 // ESPurna


+ 2
- 2
code/espurna/light.ino View File

@ -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 // Returns a PWM valule for the given channel ID
unsigned int _toPWM(unsigned char id) { unsigned int _toPWM(unsigned char id) {
if (id < _channels.size()) { if (id < _channels.size()) {
bool isColor = (lightHasColor() && id < 3);
bool isColor = lightHasColor() && (id < 3);
bool bright = isColor; bool bright = isColor;
bool gamma = isColor & (getSetting("useGamma", LIGHT_USE_GAMMA).toInt() == 1); bool gamma = isColor & (getSetting("useGamma", LIGHT_USE_GAMMA).toInt() == 1);
return _toPWM(_channels[id].shadow, bright, gamma, _channels[id].reverse); 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; 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 ) { 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[3].shadow = _channels[0].shadow * ((float) _brightness / LIGHT_MAX_BRIGHTNESS);
_channels[2].shadow = 0; _channels[2].shadow = 0;


Loading…
Cancel
Save