You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/arduino-libraries/io-abstraction/eeprom-impl-seamless-8-and-32-bit.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,26 @@ Note that on the ESP range of devices, you'll need to call `EEPROM.begin(size)`
83
83
84
84
ArduinoEEPROMAbstraction eepromWrapper(EEPROM);
85
85
86
+
### EspPreferencesEeprom for ESP32 Preferences storage
87
+
88
+
Requires ESP32 framework with Preferences library available for use. Note that in order to write back what's in memory you need to call `commit` to do the actual write.
89
+
90
+
This class wraps the preferences API that's available on ESP32 Arduino framework. To use the wrapper first include:
Where `myNamespace` is the namespace to use with preferences, and `size` is the size of the byte array it will create.
99
+
100
+
Once you've finished writing values to it, flush the values out to storage as follows:
101
+
102
+
prefsStore.commit();
103
+
104
+
A word of caution, do not call commit too often, this storage is probably in FLASH, and has limited write cycles.
105
+
86
106
### HalStm32EepromAbstraction for STM32 applications
87
107
88
108
Requires version 1.8 of IoAbstraction.
@@ -166,4 +186,4 @@ Firstly, never call save in the menu item callback, *if using a rotary encoder t
166
186
* Provide a save option somewhere that performs the save function.
167
187
* Have a task manager event or task that listens for changes and saves a maximum of once every N minutes, where N is as large as you can tolerate. This may still write to EEPROM too frequently.
168
188
169
-
[Go back to the IoAbstraction page]({{< relref "io-abstraction.md" >}})
189
+
[Go back to the IoAbstraction page]({{< relref "io-abstraction.md" >}})
0 commit comments