Skip to content

Commit

Permalink
avoid warnings of unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
elral committed Sep 20, 2023
1 parent 7b95d33 commit 442cd24
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@ void readConfig()
bool copy_success = true; // will be set to false if copying input names to nameBuffer exceeds array dimensions
// not required anymore when pins instead of names are transferred to the UI

uint16_t length = MFeeprom.get_length();
char temp = 0;
uint16_t adrPin = 0;
uint16_t adrType = 0;
uint16_t adrConfig = 0;

if (command == 0) // just to be sure, configLength should also be 0
return;

Expand Down Expand Up @@ -420,25 +414,26 @@ void readConfig()
#endif

#if MF_CUSTOMDEVICE_SUPPORT == 1
case kTypeCustomDevice:
adrType = addreeprom; // first location of custom Type in EEPROM
case kTypeCustomDevice: {
uint16_t adrType = addreeprom; // first location of custom Type in EEPROM
copy_success = readEndCommandFromEEPROM(&addreeprom, '.');
if (!copy_success)
break;

adrPin = addreeprom; // first location of custom pins in EEPROM
uint16_t adrPin = addreeprom; // first location of custom pins in EEPROM
copy_success = readEndCommandFromEEPROM(&addreeprom, '.');
if (!copy_success)
break;

adrConfig = addreeprom; // first location of custom config in EEPROM
uint16_t adrConfig = addreeprom; // first location of custom config in EEPROM
copy_success = readEndCommandFromEEPROM(&addreeprom, '.');
if (copy_success) {
CustomDevice::Add(adrPin, adrType, adrConfig);
copy_success = readEndCommandFromEEPROM(&addreeprom, ':'); // check EEPROM until end of command
}
// cmdMessenger.sendCmd(kDebug, F("CustomDevice loaded"));
break;
}
#endif

default:
Expand Down

0 comments on commit 442cd24

Please sign in to comment.