tcMenu
Loading...
Searching...
No Matches
EepromItemStorage.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
3 * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4 */
5
6#ifndef _EEPROM_ITEM_STORAGE_H_
7#define _EEPROM_ITEM_STORAGE_H_
8
13
14#include "EepromAbstraction.h"
15
16class MenuItem;
17
25void saveMenuStructure(EepromAbstraction* eeprom, uint16_t magicKey = 0xfade);
26
33bool loadMenuStructure(EepromAbstraction* eeprom, uint16_t magicKey = 0xfade);
34
42bool loadMenuItem(EepromAbstraction* eeprom, MenuItem* theItem, uint16_t magicKey = 0xfade);
43
50void saveMenuItem(EepromAbstraction* eeprom, MenuItem* theItem);
51
58
64
65enum TcEepromStorageMode {
66 TC_STORE_ROM_LEGACY,
67 TC_STORE_ROM_WITH_SIZE,
68 TC_STORE_ROM_DYNAMIC
69};
70
71void setEepromStorageMode(TcEepromStorageMode mode);
72
74 static void loadItemFromRom(EepromAbstraction* eeprom, MenuItem* nextMenuItem, EepromPosition pos, size_t len);
75 static size_t saveItemDynamically(EepromAbstraction * eeprom, MenuItem * next, uint16_t position);
76public:
77 bool loadMenuStructure(EepromAbstraction* eeprom, uint16_t magicKey = 0xf00d);
78 bool saveMenuStructure(EepromAbstraction* eeprom, uint16_t magicKey = 0xf00d);
79};
80
81#endif //_EEPROM_ITEM_STORAGE_H_
void saveMenuStructure(EepromAbstraction *eeprom, uint16_t magicKey=0xfade)
Definition EepromItemStorage.cpp:82
bool loadMenuStructure(EepromAbstraction *eeprom, uint16_t magicKey=0xfade)
Definition EepromItemStorage.cpp:171
bool loadMenuItem(EepromAbstraction *eeprom, MenuItem *theItem, uint16_t magicKey=0xfade)
Definition EepromItemStorage.cpp:190
void setSizeBasedEEPROMStorageEnabled(bool ena)
Definition EepromItemStorage.cpp:210
void triggerAllChangedCallbacks()
Definition EepromItemStorage.cpp:202
void saveMenuItem(EepromAbstraction *eeprom, MenuItem *theItem)
Definition EepromItemStorage.cpp:30
Definition EepromItemStorage.h:73
bool loadMenuStructure(EepromAbstraction *eeprom, uint16_t magicKey=0xf00d)
Definition EepromItemStorage.cpp:233
Definition MenuItems.h:338