Browse Source

lights(xxx): help 2.3.0 string deduplication

...2.6.0+ does this all by itself
master
Max Prokhorov 5 years ago
parent
commit
97821f3b21
2 changed files with 8 additions and 2 deletions
  1. +6
    -0
      code/espurna/config/progmem.h
  2. +2
    -2
      code/espurna/light.ino

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

@ -2,6 +2,12 @@
// PROGMEM definitions
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Various strings
//--------------------------------------------------------------------------------
PROGMEM const char pstr_unknown[] = "UNKNOWN";
//--------------------------------------------------------------------------------
// Reset reasons
//--------------------------------------------------------------------------------


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

@ -196,7 +196,7 @@ void _lightApplyBrightnessColor() {
}
String lightDesc(unsigned char id) {
if (id >= _light_channel.size()) return F("UNKNOWN");
if (id >= _light_channel.size()) return FPSTR(pstr_unknown);
const char tag = pgm_read_byte(&_light_channel_desc[_light_channel.size() - 1][id]);
switch (tag) {
@ -208,7 +208,7 @@ String lightDesc(unsigned char id) {
default: break;
}
return F("UNKNOWN");
return FPSTR(pstr_unknown);
}
// -----------------------------------------------------------------------------


Loading…
Cancel
Save