|
@@ -25,7 +25,7 @@ esp_err_t storage_init(char* name) {
|
|
return nvs_open(name, NVS_READWRITE, &handle);
|
|
return nvs_open(name, NVS_READWRITE, &handle);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t write_wakeup_time_str(char* key, int16_t value) {
|
|
|
|
|
|
+esp_err_t write_wakeup_time_str(const char* key, int16_t value) {
|
|
esp_err_t ret = nvs_set_i16(handle, key, value);
|
|
esp_err_t ret = nvs_set_i16(handle, key, value);
|
|
return ret | nvs_commit(handle);
|
|
return ret | nvs_commit(handle);
|
|
}
|
|
}
|
|
@@ -36,7 +36,7 @@ esp_err_t write_wakeup_time_tm(struct tm* datetime, int16_t value) {
|
|
return write_wakeup_time_str(key, value);
|
|
return write_wakeup_time_str(key, value);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t read_wakeup_time_str(char* key, int16_t* value) {
|
|
|
|
|
|
+esp_err_t read_wakeup_time_str(const char* key, int16_t* value) {
|
|
return nvs_get_i16(handle, key, value);
|
|
return nvs_get_i16(handle, key, value);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -46,7 +46,7 @@ esp_err_t read_wakeup_time_tm(struct tm* datetime, int16_t* value) {
|
|
return read_wakeup_time_str(key, value);
|
|
return read_wakeup_time_str(key, value);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t delete_wakeup_time_str(char* key) {
|
|
|
|
|
|
+esp_err_t delete_wakeup_time_str(const char* key) {
|
|
esp_err_t ret = nvs_erase_key(handle, key);
|
|
esp_err_t ret = nvs_erase_key(handle, key);
|
|
return ret | nvs_commit(handle);
|
|
return ret | nvs_commit(handle);
|
|
}
|
|
}
|