Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 8db69d3

Browse files
authored
Update README.md and use allman astyle
1 parent abb235e commit 8db69d3

21 files changed

+293
-164
lines changed

CONTRIBUTING.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,45 @@ Arduino IDE version: 1.8.19
3030
ESP8266_NODEMCU_ESP12E using ESP8266_W5500 Ethernet
3131
ESP8266 core v3.0.2
3232
OS: Ubuntu 20.04 LTS
33-
Linux xy-Inspiron-3593 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
33+
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3434
3535
Context:
36-
I encountered an endless loop while trying to connect to Local WiFi.
36+
I encountered a crash while using this library
3737
3838
Steps to reproduce:
3939
1. ...
4040
2. ...
4141
3. ...
4242
4. ...
4343
```
44+
45+
---
46+
4447
### Sending Feature Requests
4548

4649
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
4750

48-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AsyncUDP_Ethernet/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
51+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/RP2040_PWM/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
52+
53+
---
4954

5055
### Sending Pull Requests
5156

5257
Pull Requests with changes and fixes are also welcome!
5358

59+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
60+
61+
1. Change directory to the library GitHub
62+
63+
```
64+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/RP2040_PWM_GitHub/
65+
xy@xy-Inspiron-3593:~/Arduino/xy/RP2040_PWM_GitHub$
66+
```
67+
68+
2. Issue astyle command
69+
70+
```
71+
xy@xy-Inspiron-3593:~/Arduino/xy/RP2040_PWM_GitHub$ bash utils/restyle.sh
72+
```
73+
74+

changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# AsyncUDP_Ethernet
1+
# AsyncUDP_Ethernet Library
22

33
[![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncUDP_Ethernet.svg?)](https://www.ardu-badge.com/AsyncUDP_Ethernet)
44
[![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncUDP_Ethernet.svg)](https://github.com/khoih-prog/AsyncUDP_Ethernet/releases)
55
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
66
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/AsyncUDP_Ethernet.svg)](http://github.com/khoih-prog/AsyncUDP_Ethernet/issues)
77

8+
9+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
11+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-AsyncUDP_Ethernet/count.svg" title="AsyncUDP_Ethernet Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-AsyncUDP_Ethernet/count.svg" style="height: 30px;width: 200px;"></a>
13+
814
---
915
---
1016

examples/AsyncUDPClient/AsyncUDPClient.ino

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Async_UdpClient.ino
33
44
For ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
5-
5+
66
AsyncUDP_Ethernet is a Async UDP library for the ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/ASYNC_UDP_Ethernet
1010
*****************************************************************************************************************************/
@@ -28,13 +28,13 @@ AsyncUDP udp;
2828
void sendRequest();
2929

3030
// Repeat forever, millis() resolution
31-
//Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
31+
//Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
3232
Ticker sendUDPRequest;
3333

3434
void sendRequest()
3535
{
3636
UDP_LOGDEBUG1("Send broadcastTo port ", UDP_REMOTE_PORT);
37-
37+
3838
udp.broadcastTo("Anyone here?", UDP_REMOTE_PORT);
3939
}
4040

@@ -69,52 +69,56 @@ void initEthernet()
6969
#if !USING_DHCP
7070
eth.config(localIP, gateway, netMask, gateway);
7171
#endif
72-
72+
7373
eth.setDefault();
74-
75-
if (!eth.begin())
74+
75+
if (!eth.begin())
7676
{
7777
Serial.println("No Ethernet hardware ... Stop here");
78-
79-
while (true)
78+
79+
while (true)
8080
{
8181
delay(1000);
8282
}
83-
}
84-
else
83+
}
84+
else
8585
{
8686
Serial.print("Connecting to network : ");
87-
88-
while (!eth.connected())
87+
88+
while (!eth.connected())
8989
{
9090
Serial.print(".");
9191
delay(1000);
9292
}
9393
}
94-
94+
9595
Serial.println();
9696

97-
#if USING_DHCP
97+
#if USING_DHCP
9898
Serial.print("Ethernet DHCP IP address: ");
9999
#else
100100
Serial.print("Ethernet Static IP address: ");
101101
#endif
102-
102+
103103
Serial.println(eth.localIP());
104104
}
105105

106106
void setup()
107107
{
108108
Serial.begin(115200);
109+
109110
while (!Serial && millis() < 5000);
110111

111112
delay(200);
112113

113-
Serial.print("\nStart Async_UDPClient on "); Serial.print(BOARD_NAME);
114-
Serial.print(" with "); Serial.println(SHIELD_TYPE);
114+
Serial.print("\nStart Async_UDPClient on ");
115+
Serial.print(BOARD_NAME);
116+
Serial.print(" with ");
117+
Serial.println(SHIELD_TYPE);
115118
Serial.println(ASYNC_UDP_ETHERNET_VERSION);
116119

117120
initEthernet();
121+
118122
if (udp.connect(remoteIPAddress, UDP_REMOTE_PORT))
119123
{
120124
Serial.println("UDP connected");

examples/AsyncUDPClient/defines.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
5-
5+
66
AsyncUDP_Ethernet is a Async UDP library for the ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/ASYNC_UDP_Ethernet
1010
*****************************************************************************************************************************/
@@ -17,7 +17,7 @@
1717
#define LED_OFF HIGH
1818
#else
1919
#error Only ESP8266
20-
#endif
20+
#endif
2121

2222
#define _AWS_ETHERNET_LOGLEVEL_ 1
2323

@@ -34,19 +34,19 @@
3434
#if USING_W5500
3535
#include "W5500lwIP.h"
3636
#define SHIELD_TYPE "ESP8266_W5500 Ethernet"
37-
38-
Wiznet5500lwIP eth(CSPIN);
39-
37+
38+
Wiznet5500lwIP eth(CSPIN);
39+
4040
#elif USING_W5100
4141
#include <W5100lwIP.h>
4242
#define SHIELD_TYPE "ESP8266_W5100 Ethernet"
43-
43+
4444
Wiznet5100lwIP eth(CSPIN);
4545

4646
#elif USING_ENC28J60
4747
#include <ENC28J60lwIP.h>
4848
#define SHIELD_TYPE "ESP8266_ENC28J60 Ethernet"
49-
49+
5050
ENC28J60lwIP eth(CSPIN);
5151
#else
5252
// default if none selected

examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
AsyncUDPMulticastServer.ino
33
44
For ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
5-
5+
66
AsyncUDP_Ethernet is a Async UDP library for the ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/ASYNC_UDP_Ethernet
1010
*****************************************************************************************************************************/
11-
11+
1212
#include "defines.h"
1313

1414
#define ASYNC_UDP_ETHERNET_VERSION_MIN_TARGET "AsyncUDP_Ethernet v1.2.1"
@@ -24,13 +24,13 @@ AsyncUDP udp;
2424
void sendRequest();
2525

2626
// Repeat forever, millis() resolution
27-
//Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
27+
//Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
2828
Ticker sendUDPRequest;
2929

3030
void sendRequest()
3131
{
3232
UDP_LOGDEBUG("Send multicast");
33-
33+
3434
//Send multicast
3535
udp.print("Anyone here?");
3636
}
@@ -66,49 +66,52 @@ void initEthernet()
6666
#if !USING_DHCP
6767
eth.config(localIP, gateway, netMask, gateway);
6868
#endif
69-
69+
7070
eth.setDefault();
71-
72-
if (!eth.begin())
71+
72+
if (!eth.begin())
7373
{
7474
Serial.println("No Ethernet hardware ... Stop here");
75-
76-
while (true)
75+
76+
while (true)
7777
{
7878
delay(1000);
7979
}
80-
}
81-
else
80+
}
81+
else
8282
{
8383
Serial.print("Connecting to network : ");
84-
85-
while (!eth.connected())
84+
85+
while (!eth.connected())
8686
{
8787
Serial.print(".");
8888
delay(1000);
8989
}
9090
}
91-
91+
9292
Serial.println();
9393

94-
#if USING_DHCP
94+
#if USING_DHCP
9595
Serial.print("Ethernet DHCP IP address: ");
9696
#else
9797
Serial.print("Ethernet Static IP address: ");
9898
#endif
99-
99+
100100
Serial.println(eth.localIP());
101101
}
102102

103103
void setup()
104104
{
105105
Serial.begin(115200);
106+
106107
while (!Serial && millis() < 5000);
107108

108109
delay(200);
109110

110-
Serial.print("\nStart AsyncUDPMulticastServer on "); Serial.print(BOARD_NAME);
111-
Serial.print(" with "); Serial.println(SHIELD_TYPE);
111+
Serial.print("\nStart AsyncUDPMulticastServer on ");
112+
Serial.print(BOARD_NAME);
113+
Serial.print(" with ");
114+
Serial.println(SHIELD_TYPE);
112115
Serial.println(ASYNC_UDP_ETHERNET_VERSION);
113116

114117
initEthernet();

examples/AsyncUDPMulticastServer/defines.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
5-
5+
66
AsyncUDP_Ethernet is a Async UDP library for the ESP8266 with lwIP_5100, lwIP_5500 or lwIP_enc28j60 library
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/ASYNC_UDP_Ethernet
1010
*****************************************************************************************************************************/
@@ -17,7 +17,7 @@
1717
#define LED_OFF HIGH
1818
#else
1919
#error Only ESP8266
20-
#endif
20+
#endif
2121

2222
#define _AWS_ETHERNET_LOGLEVEL_ 1
2323

@@ -34,19 +34,19 @@
3434
#if USING_W5500
3535
#include "W5500lwIP.h"
3636
#define SHIELD_TYPE "ESP8266_W5500 Ethernet"
37-
38-
Wiznet5500lwIP eth(CSPIN);
39-
37+
38+
Wiznet5500lwIP eth(CSPIN);
39+
4040
#elif USING_W5100
4141
#include <W5100lwIP.h>
4242
#define SHIELD_TYPE "ESP8266_W5100 Ethernet"
43-
43+
4444
Wiznet5100lwIP eth(CSPIN);
4545

4646
#elif USING_ENC28J60
4747
#include <ENC28J60lwIP.h>
4848
#define SHIELD_TYPE "ESP8266_ENC28J60 Ethernet"
49-
49+
5050
ENC28J60lwIP eth(CSPIN);
5151
#else
5252
// default if none selected

examples/AsyncUDPServer/AsyncUDPServer.ino

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,15 @@ void initEthernet()
8181
void setup()
8282
{
8383
Serial.begin(115200);
84+
8485
while (!Serial && millis() < 5000);
8586

8687
delay(200);
8788

88-
Serial.print("\nStart AsyncUDPServer on "); Serial.print(BOARD_NAME);
89-
Serial.print(" with "); Serial.println(SHIELD_TYPE);
89+
Serial.print("\nStart AsyncUDPServer on ");
90+
Serial.print(BOARD_NAME);
91+
Serial.print(" with ");
92+
Serial.println(SHIELD_TYPE);
9093
Serial.println(ASYNC_UDP_ETHERNET_VERSION);
9194

9295
initEthernet();

0 commit comments

Comments
 (0)