Fix prefs.h

This commit is contained in:
Oleg Kalachev
2026-08-15 22:31:58 +03:00
parent ad6a58d082
commit c8af340344
+2 -5
View File
@@ -11,7 +11,7 @@ public:
Preferences() = default; Preferences() = default;
~Preferences() = default; ~Preferences() = default;
bool begin(const char *name, bool readOnly = false, const char *partition_label = NULL) { bool begin(const char *name, bool readOnly = false, const char *partition_label = nullptr) {
(void)name; (void)name;
(void)readOnly; (void)readOnly;
(void)partition_label; (void)partition_label;
@@ -128,9 +128,7 @@ private:
} }
int availableStorageSize() { int availableStorageSize() {
int n = STORAGE_SIZE; return STORAGE_SIZE;
if (EEPROM.length() > 0 && EEPROM.length() < n) n = EEPROM.length();
return n;
} }
bool save() { bool save() {
@@ -187,7 +185,6 @@ private:
for (int i = 0; i < storageSize; i++) { for (int i = 0; i < storageSize; i++) {
EEPROM.write(i, buffer[i]); EEPROM.write(i, buffer[i]);
} }
EEPROM.commit();
return true; return true;
} }