Skip to content

Commit

Permalink
Added option to disable led in espfwk instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-se committed Oct 13, 2024
1 parent 955cf29 commit 02baf91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 3 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lib_deps =
https://github.com/mp-se/arduino-mqtt#v2.5.2
https://github.com/mp-se/ESPAsyncWebServer#0.1.1
https://github.com/mp-se/ESPAsyncTCP#0.1.0
https://github.com/mp-se/espframework#1.0.6
https://github.com/mp-se/espframework#1.0.7
https://github.com/mp-se/OneWireNg#0.13.3
lib_deps32 =
https://github.com/mp-se/NimBLE-Arduino#1.4.1
Expand All @@ -64,6 +64,7 @@ build_unflags = ${common_env_data.build_unflags}
build_flags =
${common_env_data.build_flags}
-D LOG_LEVEL=5
-D DISABLE_LED
#-D USE_SERIAL_PINS # Use the TX/RX pins for the serial port
#-D RUN_HARDWARE_TEST # Will run diagnositc setup to validate the GPIO configurations
lib_deps =
Expand Down Expand Up @@ -137,6 +138,7 @@ build_flags =
#-D CORE_DEBUG_LEVEL=6
-D ESP32C3
-D ARDUINO_ESP32C3_DEV
-D DISABLE_LED
#-D ARDUINO_USB_CDC_ON_BOOT=1
#-DUSE_SERIAL_PINS # Use the TX/RX pins for the serial port
lib_deps =
Expand Down
8 changes: 0 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,9 @@ void setup() {
// Do this setup for all modes exect wifi setup
switch (runMode) {
case RunMode::wifiSetupMode:
#if !defined(ESP32C3) && !defined(ESP8266)
// We cant use LED on ESP32C3 since that pin is connected to GYRO
ledOn(LedColor::RED); // Red or fast flashing to indicate connection
// error
#endif
myWifi.startAP();
break;

Expand Down Expand Up @@ -207,10 +205,8 @@ void setup() {
case RunMode::configurationMode:
if (myWifi.isConnected()) {
Log.notice(F("Main: Activating web server." CR));
#if !defined(ESP32C3) && !defined(ESP8266)
// We cant use LED on ESP32C3 since that pin is connected to GYRO
ledOn(LedColor::BLUE); // Blue or slow flashing to indicate config mode
#endif
PERF_BEGIN("main-wifi-ota");
if (myOta.checkFirmwareVersion()) myOta.updateFirmware();
PERF_END("main-wifi-ota");
Expand All @@ -220,22 +216,18 @@ void setup() {
mySerialWebSocket.begin(myWebServer.getWebServer(), &Serial);
mySerial.begin(&mySerialWebSocket);
} else {
#if !defined(ESP32C3) && !defined(ESP8266)
// We cant use LED on ESP32C3 since that pin is connected to GYRO
ledOn(LedColor::RED); // Red or fast flashing to indicate connection
#endif
// error
}

interval = 1000; // Change interval from 200ms to 1s
break;

default:
#if !defined(ESP32C3) && !defined(ESP8266)
// We cant use LED on ESP32C3 since that pin is connected to GYRO
ledOn(
LedColor::GREEN); // Green or fast flashing to indicate gravity mode
#endif
break;
}

Expand Down

0 comments on commit 02baf91

Please sign in to comment.