/****************************************************************************** * FunctionName : user_esp_platform_set_active * Description : set active flag * Parameters : activeflag -- 0 or 1 * Returns : none *******************************************************************************/ void ICACHE_FLASH_ATTR user_esp_platform_set_active(uint8 activeflag) { esp_param.activeflag = activeflag; system_param_save_with_protect(ESP_PARAM_START_SEC, &esp_param, sizeof(esp_param)); }
void ICACHE_FLASH_ATTR app_save(void) { INFO("Flash Saved !\r\n"); // sys_status.mcu_status = local_mcu_status; system_param_save_with_protect( (APP_START_SEC), (void *)(&sys_status), sizeof(sys_status)); }
/****************************************************************************** * FunctionName : user_esp_platform_set_token * Description : save the token for the espressif's device * Parameters : token -- the parame point which write the flash * Returns : none *******************************************************************************/ void ICACHE_FLASH_ATTR user_esp_platform_set_token(uint8_t *token) { if (token == NULL) { return; } esp_param.activeflag = 0; os_memcpy(esp_param.token, token, os_strlen(token)); system_param_save_with_protect(ESP_PARAM_START_SEC, &esp_param, sizeof(esp_param)); }
void ICACHE_FLASH_ATTR ssSetConf(char *ssid, char *pwd) { if (ssid == NULL || pwd == NULL) return; strcpy(sStored.ssid, ssid); strcpy(sStored.pwd, pwd); //memcpy(&sStored.ip, ip, sizeof(sStored.ip)); sStored.cfgValid = CONFIG_MAGIC; system_param_save_with_protect(ESP_PARAM_START_SEC, &sStored, sizeof(sStored)); }