|
|
@ -14,6 +14,15 @@ static void dump_config(config_t *pcfg) { |
|
|
|
ZLOGI(TAG, "netmask : %s", inet_ntoa(pcfg->netmask)); |
|
|
|
ZLOGI(TAG, "mac : %02x:%02x:%02x:%02x:%02x:%02x", pcfg->mac[0], pcfg->mac[1], pcfg->mac[2], pcfg->mac[3], pcfg->mac[4], pcfg->mac[5]); |
|
|
|
ZLOGI(TAG, "======================================"); |
|
|
|
|
|
|
|
config_t *config = config_get(); |
|
|
|
|
|
|
|
for (uint32_t i = 0; i < ZARRAY_SIZE(config->reg_config_storage); i++) { |
|
|
|
if (config->reg_config_storage[i].add == 0) { |
|
|
|
break; |
|
|
|
} |
|
|
|
ZLOGI(TAG, "init reg [0x%x] [0x%x]", config->reg_config_storage[i].add, config->reg_config_storage[i].val); |
|
|
|
} |
|
|
|
} |
|
|
|
static void create_default_config(config_t *now_cfg, bool cfg_is_error, config_t *default_cfg) { // |
|
|
|
default_cfg->config_mark = FLASH_MASK_VAL; |
|
|
@ -58,8 +67,9 @@ void config_init(void) { |
|
|
|
/** |
|
|
|
* @brief ´òÓ¡ÅäÖÃÐÅÏ¢ |
|
|
|
*/ |
|
|
|
dump_config(&_config); |
|
|
|
// dump_config(&_config); |
|
|
|
} |
|
|
|
void config_dump() { dump_config(&_config); } |
|
|
|
config_t *config_get(void) { return &_config; } |
|
|
|
void config_flush(void) { zaf_flash_flush(); } |
|
|
|
void config_factory_reset(void) { zaf_flash_factory_reset(); } |
|
|
|