Skip to content

Commit

Permalink
Fixed issue with Gyro not working on c3 board
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-se committed Aug 27, 2024
1 parent 31ea59d commit de69e56
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ void setup() {
// Do this setup for all modes exect wifi setup
switch (runMode) {
case RunMode::wifiSetupMode:
#if !defined(ESP32C3)
// 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 @@ -210,7 +213,10 @@ void setup() {
case RunMode::configurationMode:
if (myWifi.isConnected()) {
Log.notice(F("Main: Activating web server." CR));
#if !defined(ESP32C3)
// 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,16 +226,21 @@ void setup() {
mySerialWebSocket.begin(myWebServer.getWebServer(), &Serial);
mySerial.begin(&mySerialWebSocket);
} else {
#if !defined(ESP32C3)
// 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:
ledOn(
LedColor::GREEN); // Green or fast flashing to indicate gravity mode
#if !defined(ESP32C3)
// 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 de69e56

Please sign in to comment.