int ICACHE_FLASH_ATTR cgiUpgradeRaw(HttpdConnData *connData) { int ret = cgiUploadRaw(connData); if (ret == HTTPD_CGI_DONE){ system_upgrade_flag_set(UPGRADE_FLAG_FINISH); // Schedule a reboot os_timer_disarm(&flash_reboot_timer); os_timer_setfn(&flash_reboot_timer, (os_timer_func_t *)system_upgrade_reboot, NULL); os_timer_arm(&flash_reboot_timer, 2000, 1); } return ret; }
/* cgiUpgradeRaw */ int ICACHE_FLASH_ATTR cgiUpgradeRaw(HttpdConnection * ptConnection) { /* initialization */ int iRet = 0; iRet = cgiUploadRaw(ptConnection); if (HTTPD_CGI_DONE == iRet) { /* once completed flashing */ system_upgrade_flag_set(UPGRADE_FLAG_FINISH); /* schedule reboot */ os_timer_disarm(&flash_reboot_timer); os_timer_setfn(&flash_reboot_timer, (os_timer_func_t *)system_upgrade_reboot, NULL); os_timer_arm(&flash_reboot_timer, 2000, 1); } return iRet; }