cgiflash cleanup

pull/36/merge
Thorsten von Eicken 9 years ago
parent 61a881c016
commit 0d2eed1957
  1. 24
      user/cgiflash.c
  2. 4
      user/config.c

@ -31,30 +31,6 @@ static char* ICACHE_FLASH_ATTR check_header(void *buf) {
return NULL; return NULL;
} }
#if 0
//===== Cgi that reads the SPI flash. Assumes 512KByte flash.
int ICACHE_FLASH_ATTR cgiReadFlash(HttpdConnData *connData) {
int *pos=(int *)&connData->cgiData;
if (connData->conn==NULL) {
//Connection aborted. Clean up.
return HTTPD_CGI_DONE;
}
if (*pos==0) {
os_printf("Start flash download.\n");
httpdStartResponse(connData, 200);
httpdHeader(connData, "Content-Type", "application/bin");
httpdEndHeaders(connData);
*pos=0x40200000;
return HTTPD_CGI_MORE;
}
//Send 1K of flash per call. We will get called again if we haven't sent 512K yet.
espconn_sent(connData->conn, (uint8 *)(*pos), 1024);
*pos+=1024;
if (*pos>=0x40200000+(512*1024)) return HTTPD_CGI_DONE; else return HTTPD_CGI_MORE;
}
#endif
//===== Cgi to query which firmware needs to be uploaded next //===== Cgi to query which firmware needs to be uploaded next
int ICACHE_FLASH_ATTR cgiGetFirmwareNext(HttpdConnData *connData) { int ICACHE_FLASH_ATTR cgiGetFirmwareNext(HttpdConnData *connData) {
if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up. if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up.

@ -90,7 +90,7 @@ void ICACHE_FLASH_ATTR configWipe(void) {
spi_flash_erase_sector((FLASH_ADDR+FLASH_SECT)>>12); spi_flash_erase_sector((FLASH_ADDR+FLASH_SECT)>>12);
} }
static uint32_t ICACHE_FLASH_ATTR selectPrimary(FlashFull *fc0, FlashFull *fc1); static int ICACHE_FLASH_ATTR selectPrimary(FlashFull *fc0, FlashFull *fc1);
bool ICACHE_FLASH_ATTR configRestore(void) { bool ICACHE_FLASH_ATTR configRestore(void) {
FlashFull ff0, ff1; FlashFull ff0, ff1;
@ -112,7 +112,7 @@ bool ICACHE_FLASH_ATTR configRestore(void) {
return true; return true;
} }
static uint32_t ICACHE_FLASH_ATTR selectPrimary(FlashFull *ff0, FlashFull *ff1) { static int ICACHE_FLASH_ATTR selectPrimary(FlashFull *ff0, FlashFull *ff1) {
// check CRC of ff0 // check CRC of ff0
uint16_t crc = ff0->fc.crc; uint16_t crc = ff0->fc.crc;
ff0->fc.crc = 0; ff0->fc.crc = 0;

Loading…
Cancel
Save