Skip to content

Commit

Permalink
Precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
mp-se committed Aug 27, 2024
1 parent de69e56 commit 7235d9b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ repos:
files: ^src/
exclude: 'lib/'
- id: cppcheck
args: [--force]
args: [--force,--check-level=exhaustive]
files: ^src/
exclude: 'lib/'
23 changes: 12 additions & 11 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ BleSender myBleSender;
#ifdef DEACTIVATE_SLEEPMODE
const int interval = 1000; // ms, time to wait between changes to output
#else
int interval = 200; // ms, time to wait between changes to output
int interval = 200; // ms, time to wait between changes to output
#endif
bool sleepModeAlwaysSkip =
false; // Flag set in web interface to override normal behaviour
Expand Down Expand Up @@ -155,11 +155,11 @@ void setup() {
// Do this setup for all modes exect wifi setup
switch (runMode) {
case RunMode::wifiSetupMode:
#if !defined(ESP32C3)
#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
#endif
myWifi.startAP();
break;

Expand Down Expand Up @@ -213,10 +213,10 @@ void setup() {
case RunMode::configurationMode:
if (myWifi.isConnected()) {
Log.notice(F("Main: Activating web server." CR));
#if !defined(ESP32C3)
#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
#endif
PERF_BEGIN("main-wifi-ota");
if (myOta.checkFirmwareVersion()) myOta.updateFirmware();
PERF_END("main-wifi-ota");
Expand All @@ -226,21 +226,22 @@ void setup() {
mySerialWebSocket.begin(myWebServer.getWebServer(), &Serial);
mySerial.begin(&mySerialWebSocket);
} else {
#if !defined(ESP32C3)
#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
#endif
// error
}

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

default:
#if !defined(ESP32C3)
#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
ledOn(
LedColor::GREEN); // Green or fast flashing to indicate gravity mode
#endif
break;
}

Expand Down

0 comments on commit 7235d9b

Please sign in to comment.