Skip to content

Commit 7e893e9

Browse files
Apply suggestions from code review
Co-authored-by: Lucas Saavedra Vaz <[email protected]>
1 parent 8f79cde commit 7e893e9

File tree

10 files changed

+12
-22
lines changed

10 files changed

+12
-22
lines changed

Diff for: libraries/Ethernet/examples/ETH_LAN8720/ETH_LAN8720.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
static bool eth_connected = false;
2020

21-
// WARNING: WiFiEvent is called from a separate FreeRTOS task (thread)!
21+
// WARNING: onEvent is called from a separate FreeRTOS task (thread)!
2222
void onEvent(arduino_event_id_t event)
2323
{
2424
switch (event) {

Diff for: libraries/Ethernet/examples/ETH_TLK110/ETH_TLK110.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
static bool eth_connected = false;
1818

19-
// WARNING: WiFiEvent is called from a separate FreeRTOS task (thread)!
19+
// WARNING: onEvent is called from a separate FreeRTOS task (thread)!
2020
void onEvent(arduino_event_id_t event)
2121
{
2222
switch (event) {

Diff for: libraries/Ethernet/src/ETH.h

-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
// This will be uncommented once custom SPI support is available in ESP-IDF
6464
#define ETH_SPI_SUPPORTS_CUSTOM 1
6565

66-
// #include "WiFi.h"
6766
#include "Network.h"
6867

6968
#if ETH_SPI_SUPPORTS_CUSTOM

Diff for: libraries/Network/src/NetworkClient.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
#ifndef _WIFICLIENT_H_
21-
#define _WIFICLIENT_H_
20+
#pragma once
2221

2322

2423
#include "Arduino.h"
@@ -112,4 +111,3 @@ class NetworkClient : public ESPLwIPClient
112111
using Print::write;
113112
};
114113

115-
#endif /* _WIFICLIENT_H_ */

Diff for: libraries/Network/src/NetworkInterface.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ int NetworkInterface::waitStatusBits(int bits, uint32_t timeout_ms) const {
222222
return 0;
223223
}
224224
bits = xEventGroupWaitBits(
225-
_interface_event_group, // The event group being tested.
226-
bits, // The bits within the event group to wait for.
227-
pdFALSE, // bits should be cleared before returning.
228-
pdTRUE, // Don't wait for all bits, any bit will do.
225+
_interface_event_group, // The event group being tested.
226+
bits, // The bits within the event group to wait for.
227+
pdFALSE, // bits should be cleared before returning.
228+
pdTRUE, // Don't wait for all bits, any bit will do.
229229
timeout_ms / portTICK_PERIOD_MS ) & bits; // Wait a maximum of timeout_ms for any bit to be set.
230230
return bits;
231231
}
@@ -714,6 +714,5 @@ size_t NetworkInterface::printTo(Print & out) const {
714714
bytes += out.println();
715715
}
716716

717-
// bytes += out.println();
718717
return bytes;
719718
}

Diff for: libraries/Network/src/NetworkServer.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19-
#ifndef _WIFISERVER_H_
20-
#define _WIFISERVER_H_
19+
#pragma once
2120

2221
#include "Arduino.h"
2322
#include "Server.h"
@@ -59,4 +58,3 @@ class NetworkServer {
5958
int setTimeout(uint32_t seconds);
6059
};
6160

62-
#endif /* _WIFISERVER_H_ */

Diff for: libraries/Network/src/NetworkUdp.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
* [email protected] 12/30/2008
3333
*/
3434

35-
#ifndef _WIFIUDP_H_
36-
#define _WIFIUDP_H_
35+
#ifndef _NETWORKUDP_H_
36+
#define _NETWORKUDP_H_
3737

3838
#include <Arduino.h>
3939
#include <Udp.h>
@@ -74,4 +74,4 @@ class NetworkUDP : public UDP {
7474
uint16_t remotePort();
7575
};
7676

77-
#endif /* _WIFIUDP_H_ */
77+
#endif /* _NETWORKUDP_H_ */

Diff for: libraries/WiFi/src/AP.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,4 @@ size_t APClass::printDriverInfo(Print & out) const{
337337
return bytes;
338338
}
339339

340-
341-
342-
343340
#endif /* SOC_WIFI_SUPPORTED */

Diff for: libraries/WiFi/src/STA.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "WiFiGeneric.h"
88
#include "WiFiSTA.h"
99
#if SOC_WIFI_SUPPORTED
10-
1110
#include <stdint.h>
1211
#include <stdbool.h>
1312
#include <stdio.h>

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ bool WiFiGenericClass::setHostname(const char * hostname)
368368
*/
369369
void WiFiGenericClass::_eventCallback(arduino_event_t *event)
370370
{
371-
if(!event) return; //Null would crash this function
371+
if(!event) return; //Null would crash this function
372372

373373
// log_d("Arduino Event: %d - %s", event->event_id, WiFi.eventName(event->event_id));
374374
if(event->event_id == ARDUINO_EVENT_WIFI_SCAN_DONE) {

0 commit comments

Comments
 (0)