Browse Source

Decouple EMBEDDED_WEB from SPIFFS

fastled
Xose Pérez 7 years ago
parent
commit
db155f6bb3
4 changed files with 13 additions and 3 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +9
    -0
      code/espurna/config/general.h
  3. +2
    -2
      code/espurna/espurna.ino
  4. +1
    -1
      code/espurna/web.ino

+ 1
- 0
code/espurna/config/arduino.h View File

@ -57,5 +57,6 @@
//#define ENABLE_NOFUSS 1
//#define ENABLE_RF 1
//#define ENABLE_SERIAL_DEBUG 0
//#define ENABLE_SPIFFS 1
//#define ENABLE_TERMINAL 0
//#define ENABLE_UDP_DEBUG 1

+ 9
- 0
code/espurna/config/general.h View File

@ -232,6 +232,15 @@ PROGMEM const char* const custom_reset_string[] = {
#define EMBEDDED_WEB 1
#endif
// -----------------------------------------------------------------------------
// SPIFFS
// -----------------------------------------------------------------------------
// Do not add support for SPIFFS by default
#ifndef ENABLE_SPIFFS
#define ENABLE_SPIFFS 0
#endif
// -----------------------------------------------------------------------------
// OTA & NOFUSS
// -----------------------------------------------------------------------------


+ 2
- 2
code/espurna/espurna.ino View File

@ -130,7 +130,7 @@ void hardwareSetup() {
Serial.begin(SERIAL_BAUDRATE);
#endif
#if not EMBEDDED_WEB
#if ENABLE_SPIFFS
SPIFFS.begin();
#endif
@ -173,7 +173,7 @@ void welcome() {
DEBUG_MSG_P(PSTR("Firmware size: %d bytes\n"), ESP.getSketchSize());
DEBUG_MSG_P(PSTR("Free firmware space: %d bytes\n"), ESP.getFreeSketchSpace());
#if not EMBEDDED_WEB
#if ENABLE_SPIFFS
FSInfo fs_info;
if (SPIFFS.info(fs_info)) {
DEBUG_MSG_P(PSTR("File system total size: %d bytes\n"), fs_info.totalBytes);


+ 1
- 1
code/espurna/web.ino View File

@ -999,7 +999,7 @@ void webSetup() {
_server->on("/upgrade", HTTP_POST, _onUpgrade, _onUpgradeData);
// Serve static files
#if not EMBEDDED_WEB
#if ENABLE_SPIFFS
_server->serveStatic("/", SPIFFS, "/")
.setLastModified(_last_modified)
.setFilter([](AsyncWebServerRequest *request) -> bool {


Loading…
Cancel
Save