Skip to content

Commit

Permalink
Apply suggested style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Mar 7, 2023
1 parent f783789 commit ae3479f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 31 deletions.
13 changes: 7 additions & 6 deletions libraries/esp8266/examples/AutoSleepDemo/AutoSleepDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

// enter your WiFi configuration below
const char* AP_SSID = "SSID"; // your router's SSID here
const char* AP_PASS = "PSK"; // your router's password here
const char* AP_PASS = "PSK"; // your router's password here

uint32_t timeout = 30E3; // 30 second timeout on the WiFi connection
uint32_t timeout = 30E3; // 30 second timeout on the WiFi connection
esp8266::polledTimeout::oneShotMs wifiTimeout(timeout); // 30 second timeout on WiFi connection

ESP8266WebServer server(80);
Expand All @@ -63,7 +63,8 @@ void handleNotFound() {

void setup() {
Serial.begin(74880);
while (!Serial);
while (!Serial)
;
delay(100);
Serial.println();
WiFi.mode(WIFI_STA);
Expand All @@ -83,9 +84,9 @@ void setup() {
}
WiFi.setAutoReconnect(true);

//if (MDNS.begin("esp8266")) {
// Serial.println("MDNS responder started");
//}
// if (MDNS.begin("esp8266")) {
// Serial.println("MDNS responder started");
// }

server.on("/", handleRoot);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ void wakeupCallback() {

void setup() {
Serial.begin(74880);
while (!Serial);
while (!Serial)
;
delay(100);
pinMode(LED_BUILTIN, OUTPUT); // activity and status indicator
digitalWrite(LED_BUILTIN, LOW); // turn on the LED
pinMode(LED_BUILTIN, OUTPUT); // activity and status indicator
digitalWrite(LED_BUILTIN, LOW); // turn on the LED
pinMode(WAKE_UP_PIN, INPUT_PULLUP); // polled to advance tests, interrupt for Forced Light Sleep
attachInterrupt(WAKE_UP_PIN, wakeupPinIsr, FALLING);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ void wakeupCallback() {

void setup() {
Serial.begin(74880);
while (!Serial);
while (!Serial)
;
delay(100);
pinMode(LED_BUILTIN, OUTPUT); // activity and status indicator
pinMode(LED_BUILTIN, OUTPUT); // activity and status indicator
digitalWrite(LED_BUILTIN, LOW); // turn on the LED
}

Expand Down
12 changes: 6 additions & 6 deletions libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ void runTest7() {
// WiFi.shutdown(nv->wss); // Forced Modem Sleep for a more Instant Deep Sleep,
// and no extended RFCAL as it goes into Deep Sleep
Serial.println(F("going into Deep Sleep now..."));
printMillis(); // show time difference across sleep
testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
ESP.deepSleep(10E6); // good night! D0 fires a reset in 10 seconds...
printMillis(); // show time difference across sleep
testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
ESP.deepSleep(10E6); // good night! D0 fires a reset in 10 seconds...
// if you do ESP.deepSleep(0); it needs a RESET to come out of sleep (RTC is disconnected)
// maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
// the 2 uA GPIO amperage during Deep Sleep can't drive the LED so it's not lit now, although
Expand All @@ -309,7 +309,7 @@ void runTest8() {
Serial.println(F("going into Deep Sleep now..."));
Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
ESP.deepSleep(10E6); // good night! D0 fires a reset in 10 seconds...
ESP.deepSleep(10E6); // good night! D0 fires a reset in 10 seconds...
Serial.println(F("What... I'm not asleep?!?")); // it will never get here
}

Expand All @@ -322,7 +322,7 @@ void runTest9() {
Serial.println(F("going into Deep Sleep now..."));
Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
ESP.deepSleepInstant(10E6); // good night! D0 fires a reset in 10 seconds...
ESP.deepSleepInstant(10E6); // good night! D0 fires a reset in 10 seconds...
Serial.println(F("What... I'm not asleep?!?")); // it will never get here
}

Expand All @@ -335,7 +335,7 @@ void runTest10() {
Serial.println(F("going into Deep Sleep now..."));
Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
ESP.deepSleepInstant(10E6); // good night! D0 fires a reset in 10 seconds...
ESP.deepSleepInstant(10E6); // good night! D0 fires a reset in 10 seconds...
Serial.println(F("What... I'm not asleep?!?")); // it will never get here
}

Expand Down
20 changes: 6 additions & 14 deletions tests/host/common/MockEsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ bool EspClass::forcedModemSleep(uint32_t duration_us, void (*wakeupCb)())
return true;
}

void EspClass::forcedModemSleepOff()
{
}
void EspClass::forcedModemSleepOff() { }

bool EspClass::forcedLightSleepBegin(uint32_t duration_us, void (*wakeupCb)())
{
Expand All @@ -116,21 +114,15 @@ void EspClass::forcedLightSleepEnd(bool cancel)
(void)cancel;
}

void EspClass::autoModemSleep() {
}

void EspClass::autoLightSleep() {
}
void EspClass::autoModemSleep() { }

void EspClass::autoSleepOff() {
}
void EspClass::autoLightSleep() { }

void EspClass::neverSleep() {
}
void EspClass::autoSleepOff() { }

void EspClass::neverSleepOff() {
}
void EspClass::neverSleep() { }

void EspClass::neverSleepOff() { }

void EspClass::restart()
{
Expand Down

0 comments on commit ae3479f

Please sign in to comment.