Hi, I would like to save the menu across boots but it's not working. I'm saving it with
menuMgr.save(); or menuMgr.save(0xd00d);
and then loading it with either
menuMgr.load(); or menuMgr.load(0xd00d);
but as soon as I try to load, it crashes and it goes in a boot loop. According to the nokia5110 example this should be the correct way to same/load the menu?
I'm using ESP32-S2
Please let me know thanks!
tried the 3rd option in the designer and this is my setup:
EEPROM.begin(EEPROM_SIZE);
setupMenu();
menuMgr.setEepromRef(menuMgr.getEepromAbstraction());
menuMgr.load(0xfade);
the save is done when I change one BooleanMenuItem
void CALLBACK_FUNCTION onBoolChanged(int id) {
Serial.println("onBoolChanged");
menuMgr.save(0xfade);
EEPROM.commit();
}
Seems to work for now. Let me know if I'm using it incorrectly
Nothing actually wrong. But you should be able to drop this line, you could try commenting out and should still run:
menuMgr.setEepromRef(menuMgr.getEepromAbstraction())
Reason: it shouldn't be needed, it will already have been set within setupMenu(). You just need to make sure that any EEPROM usage is after setupMenu() is called as it's not initialized before that.