MeterLogger
|
#include <stddef.h>
#include <esp8266.h>
#include "mqtt.h"
#include "config.h"
#include "user_config.h"
#include "debug.h"
#include "utils.h"
#include "tinyprintf.h"
#include "driver/ext_spi_flash.h"
Go to the source code of this file.
Macros | |
#define | EXT_CFG_LOCATION 0x0 |
#define | EXT_SPI_RAM_SEC_SIZE 0x200 |
#define | SAVE_DEFER_TIME 2000 |
Functions | |
void ICACHE_FLASH_ATTR | cfg_save () |
void ICACHE_FLASH_ATTR | cfg_load () |
void ICACHE_FLASH_ATTR | cfg_save_defered () |
ICACHE_FLASH_ATTR void | config_save_timer_func (void *arg) |
Variables | |
syscfg_t | sys_cfg |
SAVE_FLAG | saveFlag |
static os_timer_t | config_save_timer |
char | config_save_timer_running |
#define EXT_CFG_LOCATION 0x0 |
Definition at line 15 of file config.c.
Referenced by cfg_load(), and cfg_save().
#define EXT_SPI_RAM_SEC_SIZE 0x200 |
Definition at line 20 of file config.c.
Referenced by cfg_load(), and cfg_save().
#define SAVE_DEFER_TIME 2000 |
Definition at line 23 of file config.c.
Referenced by cfg_save_defered(), and config_save_timer_func().
void ICACHE_FLASH_ATTR cfg_load | ( | ) |
Definition at line 77 of file config.c.
References ccit_crc16(), syscfg_t::ccit_crc16, CFG_LOCATION, cfg_save(), DEFAULT_METER_SERIAL, DEFAULT_SECURITY, EXT_CFG_LOCATION, ext_spi_flash_read(), EXT_SPI_RAM_SEC_SIZE, ICACHE_FLASH_ATTR, INFO, key, memcpy, memset, METER_SERIAL_LEN, MQTT_CLIENT_ID, MQTT_HOST, MQTT_KEEPALIVE, MQTT_PASS, MQTT_PORT, MQTT_USER, os_memset, os_printf, STA_PASS, STA_SSID, STA_TYPE, system_get_chip_id(), system_param_load(), and tfp_snprintf().
Referenced by tplSetup().
void ICACHE_FLASH_ATTR cfg_save | ( | ) |
Definition at line 28 of file config.c.
References ccit_crc16(), syscfg_t::ccit_crc16, CFG_LOCATION, EXT_CFG_LOCATION, ext_spi_flash_erase_sector(), ext_spi_flash_read(), ext_spi_flash_write(), EXT_SPI_RAM_SEC_SIZE, ICACHE_FLASH_ATTR, and system_param_save_with_protect().
Referenced by cfg_load(), cgiSetup(), and config_save_timer_func().
void ICACHE_FLASH_ATTR cfg_save_defered | ( | ) |
Definition at line 144 of file config.c.
References config_save_timer, config_save_timer_func(), ICACHE_FLASH_ATTR, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, and SAVE_DEFER_TIME.
Referenced by ac_thermo_close(), ac_thermo_open(), add_cron_job_from_query(), and clear_cron_jobs().
ICACHE_FLASH_ATTR void config_save_timer_func | ( | void * | arg | ) |
Definition at line 151 of file config.c.
References cfg_save(), config_save_timer, config_save_timer_func(), config_save_timer_running, NULL, os_timer_arm, os_timer_disarm, os_timer_func_t, os_timer_setfn, and SAVE_DEFER_TIME.
Referenced by cfg_save_defered(), and config_save_timer_func().
|
static |
Definition at line 24 of file config.c.
Referenced by cfg_save_defered(), and config_save_timer_func().
char config_save_timer_running |
Definition at line 25 of file config.c.
Referenced by config_save_timer_func().
syscfg_t sys_cfg |
Definition at line 12 of file config.c.
Referenced by ac_thermo_close(), ac_thermo_open(), add_cron_job_from_query(), cgiSetup(), clear_cron_jobs(), cron_init(), minute_timer_func(), tplSetup(), wifi_connect(), wifi_default(), wifi_fallback(), wifi_handle_event_cb(), wifi_reconnect_timer_func(), and wifi_scan_done_cb().