-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Lines 868 to 876 in 657c600
| String flag = String(ESR_METER_FLAG); | |
| String flag_read = String(""); | |
| char c = '\0'; | |
| // Try to read ESR_METER_FLAG from EEPROM | |
| for (uint16_t i = 0; i < flag.length(); i++) { | |
| c = EEPROM.read(ESR_METER_FLAG_EEPROM_OFFSET + i); | |
| flag_read += c; | |
| } |
and
Lines 895 to 897 in 657c600
| for (uint16_t i = 0; i < flag.length(); i++) { | |
| EEPROM.write(ESR_METER_FLAG_EEPROM_OFFSET + i, flag[i]); | |
| } |
maybe replace with:
const char flag[] = ESR_METER_FLAG;
char flag_read[sizeof(flag)] = {0};
EEPROM.get(ESR_METER_FLAG_EEPROM_OFFSET, flag_read);and respectively
EEPROM.put(ESR_METER_FLAG_EEPROM_OFFSET, flag);links:
https://docs.arduino.cc/learn/built-in-libraries/eeprom/#get
https://docs.arduino.cc/learn/built-in-libraries/eeprom/#put
latchdevel
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers