From 0892eb271d17782a72629ba6968c611c6db769a1 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 8 Mar 2021 07:53:27 +0100 Subject: [PATCH] Minor F() fixes. --- wled00/cfg.cpp | 8 ++++---- wled00/json.cpp | 4 ++-- wled00/wled.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 8fd25088..c8ad3a5b 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -30,8 +30,8 @@ void deserializeConfig() { return; } - //int rev_major = doc["rev"][0]; // 1 - //int rev_minor = doc["rev"][1]; // 0 + //int rev_major = doc[F("rev")][0]; // 1 + //int rev_minor = doc[F("rev")][1]; // 0 //long vid = doc[F("vid")]; // 2010020 @@ -127,7 +127,7 @@ void deserializeConfig() { //(this shouldn't have been in ins obj. but remains here for compatibility) skipFirstLed |= skipFirst = (bool) elm[F("skip")]; uint8_t ledType = elm[F("type")] | TYPE_WS2812_RGB; - bool reversed = elm["rev"]; + bool reversed = elm[F("rev")]; //RGBW mode is enabled if at least one of the strips is RGBW if ((bool)elm[F("rgbw")]) SET_BIT(ledType,7); else UNSET_BIT(ledType,7); // hack bit 7 to indicate RGBW (as an override if necessary) useRGBW |= (bool)elm[F("rgbw")]; @@ -176,7 +176,7 @@ void deserializeConfig() { rlyPin = -1; } if (relay.containsKey("rev")) { - rlyMde = !relay["rev"]; + rlyMde = !relay[F("rev")]; } //int hw_status_pin = hw[F("status")][F("pin")]; // -1 diff --git a/wled00/json.cpp b/wled00/json.cpp index 02f14078..68475ace 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -89,7 +89,7 @@ void deserializeSegment(JsonObject elem, byte it) //if (pal != seg.palette && pal < strip.getPaletteCount()) strip.setPalette(pal); seg.setOption(SEG_OPTION_SELECTED, elem[F("sel")] | seg.getOption(SEG_OPTION_SELECTED)); - seg.setOption(SEG_OPTION_REVERSED, elem["rev"] | seg.getOption(SEG_OPTION_REVERSED)); + seg.setOption(SEG_OPTION_REVERSED, elem[F("rev")] | seg.getOption(SEG_OPTION_REVERSED)); seg.setOption(SEG_OPTION_MIRROR , elem[F("mi")] | seg.getOption(SEG_OPTION_MIRROR )); //temporary, strip object gets updated via colorUpdated() @@ -329,7 +329,7 @@ void serializeSegment(JsonObject& root, WS2812FX::Segment& seg, byte id, bool fo root[F("ix")] = seg.intensity; root[F("pal")] = seg.palette; root[F("sel")] = seg.isSelected(); - root["rev"] = seg.getOption(SEG_OPTION_REVERSED); + root[F("rev")] = seg.getOption(SEG_OPTION_REVERSED); root[F("mi")] = seg.getOption(SEG_OPTION_MIRROR); } diff --git a/wled00/wled.h b/wled00/wled.h index d5e0ba1f..a963ef70 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2103074 +#define VERSION 2103080 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG