Skip to content

Commit 9ce044e

Browse files
committed
code style
1 parent a796079 commit 9ce044e

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

examples/esp8266/WebSocketServerAllFunctionsDemo/WebSocketServerAllFunctionsDemo.ino

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#define USE_SERIAL Serial
2222

23-
2423
ESP8266WiFiMulti WiFiMulti;
2524

2625
ESP8266WebServer server(80);
@@ -49,9 +48,9 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t length
4948
// decode rgb data
5049
uint32_t rgb = (uint32_t) strtol((const char *) &payload[1], NULL, 16);
5150

52-
analogWrite(LED_RED, ((rgb >> 16) & 0xFF));
53-
analogWrite(LED_GREEN, ((rgb >> 8) & 0xFF));
54-
analogWrite(LED_BLUE, ((rgb >> 0) & 0xFF));
51+
analogWrite(LED_RED, ((rgb >> 16) & 0xFF));
52+
analogWrite(LED_GREEN, ((rgb >> 8) & 0xFF));
53+
analogWrite(LED_BLUE, ((rgb >> 0) & 0xFF));
5554
}
5655

5756
break;
@@ -119,15 +118,15 @@ unsigned long last_10sec = 0;
119118
unsigned int counter = 0;
120119

121120
void loop() {
122-
unsigned long t = millis();
123-
webSocket.loop();
124-
server.handleClient();
125-
126-
if((t - last_10sec) > 10 * 1000) {
127-
counter++;
128-
bool ping = (counter % 2);
129-
int i = webSocket.connectedClients(ping);
130-
USE_SERIAL.printf("%d Connected websocket clients ping: %d", i, ping);
131-
last_10sec = millis();
132-
}
121+
unsigned long t = millis();
122+
webSocket.loop();
123+
server.handleClient();
124+
125+
if((t - last_10sec) > 10 * 1000) {
126+
counter++;
127+
bool ping = (counter % 2);
128+
int i = webSocket.connectedClients(ping);
129+
USE_SERIAL.printf("%d Connected websocket clients ping: %d\n", i, ping);
130+
last_10sec = millis();
131+
}
133132
}

0 commit comments

Comments
 (0)