From f654a235339358f7304df3f57d23e80906bd9ecc Mon Sep 17 00:00:00 2001 From: david gauchard Date: Thu, 26 Apr 2018 12:41:25 +0200 Subject: [PATCH] example astyled --- .../examples/interactive/interactive.ino | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino index 4df0658ef1..bf084c9674 100644 --- a/libraries/esp8266/examples/interactive/interactive.ino +++ b/libraries/esp8266/examples/interactive/interactive.ino @@ -3,7 +3,7 @@ Interactive script meant for debugging only Run it on serial console and keep this source file opened for the list of commands Please configure SSID, PSK and IPAddresses below to fit with your network - + Released to public domain */ @@ -17,16 +17,14 @@ IPAddress staticip(192, 168, 1, 123); IPAddress gateway(192, 168, 1, 254); IPAddress subnet(255, 255, 255, 0); -void setup() -{ +void setup() { Serial.begin(115200); Serial.setDebugOutput(true); WiFi.mode(WIFI_STA); WiFi.begin(SSID, PSK); Serial.println("connecting"); - while (WiFi.status() != WL_CONNECTED) - { + while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } @@ -43,16 +41,14 @@ void setup() ); } -void WiFiOn () -{ +void WiFiOn() { wifi_fpm_do_wakeup(); wifi_fpm_close(); wifi_set_opmode(STATION_MODE); wifi_station_connect(); } -void WiFiOff () -{ +void WiFiOff() { wifi_station_disconnect(); wifi_set_opmode(NULL_MODE); wifi_set_sleep_type(MODEM_SLEEP_T); @@ -60,8 +56,7 @@ void WiFiOff () wifi_fpm_do_sleep(0xFFFFFFF); } -void loop() -{ +void loop() { #define TEST(name, var, varinit, func) \ static decltype(func) var = (varinit); \ if ((var) != (func)) { var = (func); Serial.printf("**** %s: ", name); Serial.println(var); } @@ -73,8 +68,7 @@ void loop() TEST("STA-IP", localIp, (uint32_t)0, WiFi.localIP()); TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP()); - switch (Serial.read()) - { + switch (Serial.read()) { case 'F': DO(WiFiOff()); case 'N': DO(WiFiOn()); case '1': DO(WiFi.mode(WIFI_AP));