Added flash upload function
This commit is contained in:
+19
-5
@@ -47,10 +47,22 @@ int myPassFn(HttpdConnData *connData, int no, char *user, int userLen, char *pas
|
||||
}
|
||||
|
||||
#ifdef ESPFS_POS
|
||||
CgiUploadEspfsParams espfsParams={
|
||||
.espFsPos=ESPFS_POS,
|
||||
.espFsSize=ESPFS_SIZE
|
||||
CgiUploadFlashDef uploadParams={
|
||||
.type=CGIFLASH_TYPE_ESPFS,
|
||||
.fw1Pos=ESPFS_POS,
|
||||
.fw2Pos=0,
|
||||
.fwSize=ESPFS_SIZE,
|
||||
};
|
||||
#define INCLUDE_FLASH_FNS
|
||||
#endif
|
||||
#ifdef OTA_FLASH_SIZE_K
|
||||
CgiUploadFlashDef uploadParams={
|
||||
.type=CGIFLASH_TYPE_FW,
|
||||
.fw1Pos=0x1000,
|
||||
.fw2Pos=((OTA_FLASH_SIZE_K*1024)/2)+0x1000,
|
||||
.fwSize=((OTA_FLASH_SIZE_K*1024)/2)-0x1000,
|
||||
};
|
||||
#define INCLUDE_FLASH_FNS
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -71,8 +83,10 @@ HttpdBuiltInUrl builtInUrls[]={
|
||||
{"/index.tpl", cgiEspFsTemplate, tplCounter},
|
||||
{"/led.cgi", cgiLed, NULL},
|
||||
{"/flash/download", cgiReadFlash, NULL},
|
||||
{"/flash/next", cgiGetFirmwareNext, NULL},
|
||||
{"/flash/upload", cgiUploadFirmware, NULL},
|
||||
#ifdef INCLUDE_FLASH_FNS
|
||||
{"/flash/next", cgiGetFirmwareNext, &uploadParams},
|
||||
{"/flash/upload", cgiUploadFirmware, &uploadParams},
|
||||
#endif
|
||||
{"/flash/reboot", cgiRebootFirmware, NULL},
|
||||
|
||||
//Routines to make the /wifi URL and everything beneath it work.
|
||||
|
||||
Reference in New Issue
Block a user