|
@@ -25,22 +25,22 @@ 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, uint16_t value) {
|
|
|
|
- esp_err_t ret = nvs_set_u16(handle, key, value);
|
|
|
|
|
|
+esp_err_t write_wakeup_time_str(char* key, int16_t value) {
|
|
|
|
+ esp_err_t ret = nvs_set_i16(handle, key, value);
|
|
return ret | nvs_commit(handle);
|
|
return ret | nvs_commit(handle);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t write_wakeup_time_tm(struct tm* datetime, uint16_t value) {
|
|
|
|
|
|
+esp_err_t write_wakeup_time_tm(struct tm* datetime, int16_t value) {
|
|
char key[9];
|
|
char key[9];
|
|
format_date(datetime, key);
|
|
format_date(datetime, key);
|
|
return write_wakeup_time_str(key, value);
|
|
return write_wakeup_time_str(key, value);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t read_wakeup_time_str(char* key, uint16_t* value) {
|
|
|
|
- return nvs_get_u16(handle, key, value);
|
|
|
|
|
|
+esp_err_t read_wakeup_time_str(char* key, int16_t* value) {
|
|
|
|
+ return nvs_get_i16(handle, key, value);
|
|
}
|
|
}
|
|
|
|
|
|
-esp_err_t read_wakeup_time_tm(struct tm* datetime, uint16_t* value) {
|
|
|
|
|
|
+esp_err_t read_wakeup_time_tm(struct tm* datetime, int16_t* value) {
|
|
char key[9];
|
|
char key[9];
|
|
format_date(datetime, key);
|
|
format_date(datetime, key);
|
|
return read_wakeup_time_str(key, value);
|
|
return read_wakeup_time_str(key, value);
|