BTNPIN can now be disabled by setting to -1 (fixes #1237)

Added HEX color receiving to JSON API
Moved Kelvin color receiving in JSON API
This commit is contained in:
cschwinne
2020-11-20 00:33:17 +01:00
parent e19ab9a0d5
commit 4875f5e275
8 changed files with 69 additions and 30 deletions

View File

@@ -317,7 +317,7 @@ void WLED::beginStrip()
strip.setBrightness(0);
strip.setShowCallback(handleOverlayDraw);
#ifdef BTNPIN
#if defined(BTNPIN) && BTNPIN > -1
pinManager.allocatePin(BTNPIN, false);
pinMode(BTNPIN, INPUT_PULLUP);
#endif
@@ -342,7 +342,7 @@ void WLED::beginStrip()
#endif
// disable button if it is "pressed" unintentionally
#if defined(BTNPIN) || defined(TOUCHPIN)
#if (defined(BTNPIN) && BTNPIN > -1) || defined(TOUCHPIN)
if (isButtonPressed())
buttonEnabled = false;
#else