Skip to content

Commit 02baf91

Browse files
committed
Added option to disable led in espfwk instead
1 parent 955cf29 commit 02baf91

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

platformio.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ lib_deps =
4141
https://github.com/mp-se/arduino-mqtt#v2.5.2
4242
https://github.com/mp-se/ESPAsyncWebServer#0.1.1
4343
https://github.com/mp-se/ESPAsyncTCP#0.1.0
44-
https://github.com/mp-se/espframework#1.0.6
44+
https://github.com/mp-se/espframework#1.0.7
4545
https://github.com/mp-se/OneWireNg#0.13.3
4646
lib_deps32 =
4747
https://github.com/mp-se/NimBLE-Arduino#1.4.1
@@ -64,6 +64,7 @@ build_unflags = ${common_env_data.build_unflags}
6464
build_flags =
6565
${common_env_data.build_flags}
6666
-D LOG_LEVEL=5
67+
-D DISABLE_LED
6768
#-D USE_SERIAL_PINS # Use the TX/RX pins for the serial port
6869
#-D RUN_HARDWARE_TEST # Will run diagnositc setup to validate the GPIO configurations
6970
lib_deps =
@@ -137,6 +138,7 @@ build_flags =
137138
#-D CORE_DEBUG_LEVEL=6
138139
-D ESP32C3
139140
-D ARDUINO_ESP32C3_DEV
141+
-D DISABLE_LED
140142
#-D ARDUINO_USB_CDC_ON_BOOT=1
141143
#-DUSE_SERIAL_PINS # Use the TX/RX pins for the serial port
142144
lib_deps =

src/main.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,9 @@ void setup() {
149149
// Do this setup for all modes exect wifi setup
150150
switch (runMode) {
151151
case RunMode::wifiSetupMode:
152-
#if !defined(ESP32C3) && !defined(ESP8266)
153152
// We cant use LED on ESP32C3 since that pin is connected to GYRO
154153
ledOn(LedColor::RED); // Red or fast flashing to indicate connection
155154
// error
156-
#endif
157155
myWifi.startAP();
158156
break;
159157

@@ -207,10 +205,8 @@ void setup() {
207205
case RunMode::configurationMode:
208206
if (myWifi.isConnected()) {
209207
Log.notice(F("Main: Activating web server." CR));
210-
#if !defined(ESP32C3) && !defined(ESP8266)
211208
// We cant use LED on ESP32C3 since that pin is connected to GYRO
212209
ledOn(LedColor::BLUE); // Blue or slow flashing to indicate config mode
213-
#endif
214210
PERF_BEGIN("main-wifi-ota");
215211
if (myOta.checkFirmwareVersion()) myOta.updateFirmware();
216212
PERF_END("main-wifi-ota");
@@ -220,22 +216,18 @@ void setup() {
220216
mySerialWebSocket.begin(myWebServer.getWebServer(), &Serial);
221217
mySerial.begin(&mySerialWebSocket);
222218
} else {
223-
#if !defined(ESP32C3) && !defined(ESP8266)
224219
// We cant use LED on ESP32C3 since that pin is connected to GYRO
225220
ledOn(LedColor::RED); // Red or fast flashing to indicate connection
226-
#endif
227221
// error
228222
}
229223

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

233227
default:
234-
#if !defined(ESP32C3) && !defined(ESP8266)
235228
// We cant use LED on ESP32C3 since that pin is connected to GYRO
236229
ledOn(
237230
LedColor::GREEN); // Green or fast flashing to indicate gravity mode
238-
#endif
239231
break;
240232
}
241233

0 commit comments

Comments
 (0)