12345678910111213141516171819202122 |
- /*
- * SPDX-FileCopyrightText: 2022-2023 Helmut Pozimski <helmut@pozimski.eu>
- *
- * SPDX-License-Identifier: GPL-2.0-only
- */
- #include <stdint.h>
- #include <time.h>
- #include <esp_err.h>
- #include <nvs_flash.h>
- #define NUM_WEEK_DAYS 7
- static const char WEEK_DAYS[NUM_WEEK_DAYS + 1][4] = {"UNU", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
- esp_err_t storage_init(const char* name);
- esp_err_t write_wakeup_time_tm(struct tm* datetime, int16_t value);
- esp_err_t write_wakeup_time_str(const char* key, int16_t value);
- esp_err_t read_wakeup_time_tm(struct tm* datetime, int16_t* value);
- esp_err_t read_wakeup_time_str(const char* key, int16_t* value);
- esp_err_t delete_wakeup_time_str(const char* key);
- void delete_outdated_entries(struct tm* datetime, const char* namespace);
|