set buttonBriDirection as local static

This commit is contained in:
gaaat98
2024-04-26 18:23:34 +02:00
committed by GitHub
parent 6276c2f1f5
commit bdd4d9f3ff
2 changed files with 1 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
#define WLED_LONG_BRI_STEPS 16 // how long to wait before increasing/decreasing brightness on long press
static const char _mqtt_topic_button[] PROGMEM = "%s/button/%d"; // optimize flash usage
static bool buttonBriDirection = false; // true: increase brightness, false: decrease brightness
void shortPressAction(uint8_t b)
{
@@ -41,7 +42,6 @@ void longPressAction(uint8_t b)
switch (b) {
case 0: setRandomColor(col); colorUpdated(CALL_MODE_BUTTON); break;
case 1:
// increase bri on true, decrease on false
if(buttonBriDirection) {
if (bri == 255) break; // avoid unnecessary updates to brightness
if (bri >= 255 - WLED_LONG_BRI_STEPS) bri = 255;