From e69481cb938c0352cb2b4881f6e15ffdaebb7f3b Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 6 Dec 2024 02:10:30 -0800 Subject: [PATCH] added serial check and fixed leds macro --- VortexEngine/src/Leds/Leds.cpp | 7 +------ VortexEngine/src/VortexEngine.cpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/VortexEngine/src/Leds/Leds.cpp b/VortexEngine/src/Leds/Leds.cpp index e83e752c0f..09a665aa06 100644 --- a/VortexEngine/src/Leds/Leds.cpp +++ b/VortexEngine/src/Leds/Leds.cpp @@ -15,12 +15,7 @@ #ifdef VORTEX_EMBEDDED #pragma GCC diagnostic ignored "-Wclass-memaccess" #include -#define LED_PIN 0 -#if SPARK_HANDLE == 1 -#define MOSFET_PIN 48 -#else -#define MOSFET_PIN 18 -#endif +#define LED_PIN 0 #endif // global brightness diff --git a/VortexEngine/src/VortexEngine.cpp b/VortexEngine/src/VortexEngine.cpp index 087931c7d9..69e27034c9 100644 --- a/VortexEngine/src/VortexEngine.cpp +++ b/VortexEngine/src/VortexEngine.cpp @@ -30,14 +30,14 @@ bool VortexEngine::m_autoCycle = false; bool VortexEngine::init() { // all of the global controllers - if (!SerialComs::init()) { - DEBUG_LOG("Serial failed to initialize"); - return false; - } if (!Time::init()) { DEBUG_LOG("Time failed to initialize"); return false; } + if (!SerialComs::init()) { + DEBUG_LOG("Serial failed to initialize"); + return false; + } if (!Storage::init()) { DEBUG_LOG("Storage failed to initialize"); return false; @@ -178,6 +178,13 @@ void VortexEngine::runMainLogic() return; } + // check for serial first before anything runs, but as a result if we open + // editor we have to call modes load inside here + if (SerialComs::checkSerial()) { + // directly open the editor connection menu because we are connected to USB serial + Menus::openMenu(MENU_EDITOR_CONNECTION); + } + // if the menus are open and running then just return if (Menus::run()) { return;