diff --git a/src/Sys/SysModWeb.cpp b/src/Sys/SysModWeb.cpp index 7273e7c6..cf94edad 100644 --- a/src/Sys/SysModWeb.cpp +++ b/src/Sys/SysModWeb.cpp @@ -17,6 +17,7 @@ #include "SysModPins.h" #include "User/UserModMDNS.h" +// got multiple definition error here ??? see workaround below // #ifdef STARBASE_USERMOD_LIVE // #include "../User/UserModLive.h" // #endif @@ -505,10 +506,14 @@ void SysModWeb::serveUpload(WebRequest *request, const String& filename, size_t files->filesChanged = true; //if sc files send command to live - // #ifdef STARBASE_USERMOD_LIVE - // if (filename.indexOf(".sc") > 0) - // liveM->run(filename.c_str()); - // #endif + #ifdef STARBASE_USERMOD_LIVE + + strcpy(lastFileUpdated, filename.c_str()); //workaround + + // got multiple definition error here ??? + // if (filename.indexOf(".sc") > 0) + // liveM->run(filename.c_str()); + #endif } } diff --git a/src/Sys/SysModWeb.h b/src/Sys/SysModWeb.h index 5e8ae4a1..1051cd88 100644 --- a/src/Sys/SysModWeb.h +++ b/src/Sys/SysModWeb.h @@ -57,6 +57,10 @@ class SysModWeb:public SysModule { unsigned8 recvUDPCounter = 0; unsigned16 recvUDPBytes = 0; + #ifdef STARBASE_USERMOD_LIVE + char lastFileUpdated[30] = ""; //workaround! + #endif + SysModWeb(); void setup(); diff --git a/src/User/UserModLive.h b/src/User/UserModLive.h index 73b25bab..21dfaf78 100644 --- a/src/User/UserModLive.h +++ b/src/User/UserModLive.h @@ -160,6 +160,14 @@ class UserModLive:public SysModule { time1 = ESP.getCycleCount(); } + void loop20ms() { + //workaround + if (strstr(web->lastFileUpdated, ".sc") != nullptr) { + run(web->lastFileUpdated); + strcpy(web->lastFileUpdated, ""); + } + } + void loop1s() { mdl->setUIValueV("fps1", "%.0f /s", fps); mdl->setUIValueV("fps2", "%d /s", frameCounter);