Commit a83ed496 authored by PhiBo's avatar PhiBo 🚀

New function to submit files from flash

parent 6aab6688
......@@ -293,3 +293,18 @@ void handleSSID()
}
void submitFile(PGM_VOID_P mem, uint16_t size)
{
uint16_t i, j;
uint8_t buf[200];
i = 0;
while(i < size) {
j = size - i;
if(j > 200) {
j = 200;
}
memcpy_P(buf, mem + i, j);
server->client().write(&buf[0], j);
i += 200;
}
}
......@@ -74,6 +74,7 @@ void ICACHE_FLASH_ATTR handleRoot();
void ICACHE_FLASH_ATTR handleSave();
void ICACHE_FLASH_ATTR handleScanSSID();
void ICACHE_FLASH_ATTR handleSSID();
void ICACHE_FLASH_ATTR submitFile(PGM_VOID_P, uint16_t);
extern ESP8266WebServer *server;
extern WiFiClient *client;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment