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

Commit f775e61

Browse files
authored
Update README.md and use allman astyle
1 parent 87619ea commit f775e61

21 files changed

+245
-113
lines changed

CONTRIBUTING.md

+27-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.56`)
19-
* `QNEthernet` library version (e.g. `QNEthernet v0.13.0`)
18+
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.57`)
19+
* `QNEthernet` library version (e.g. `QNEthernet v0.16.0`)
2020
* Board type and relevant info
2121
* Contextual information (e.g. what you were trying to achieve)
2222
* Simplest possible steps to reproduce
@@ -29,27 +29,47 @@ Please ensure to specify the following:
2929

3030
```
3131
Arduino IDE version: 1.8.19
32-
Teensyduino core v1.56
33-
Teensy 4.1 using QNEthernet v0.13.0
32+
Teensyduino core v1.57
33+
Teensy 4.1 using QNEthernet v0.16.0
3434
OS: Ubuntu 20.04 LTS
35-
Linux xy-Inspiron-3593 5.13.0-35-generic #40~20.04.1-Ubuntu SMP Mon Mar 7 09:18:32 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
35+
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
3636
3737
Context:
38-
I encountered an endless loop while trying to connect to Local WiFi.
38+
I encountered a crash while using this library
3939
4040
Steps to reproduce:
4141
1. ...
4242
2. ...
4343
3. ...
4444
4. ...
4545
```
46+
47+
---
48+
4649
### Sending Feature Requests
4750

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

50-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AsyncUDP_Teensy41/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
53+
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.
54+
55+
---
5156

5257
### Sending Pull Requests
5358

5459
Pull Requests with changes and fixes are also welcome!
5560

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

changelog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
# AsyncUDP_Teensy41
1+
# AsyncUDP_Teensy41 Library
22

33
[![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncUDP_Teensy41.svg?)](https://www.ardu-badge.com/AsyncUDP_Teensy41)
44
[![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncUDP_Teensy41.svg)](https://github.com/khoih-prog/AsyncUDP_Teensy41/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_Teensy41.svg)](http://github.com/khoih-prog/AsyncUDP_Teensy41/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_Teensy41/count.svg" title="AsyncUDP_Teensy41 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-AsyncUDP_Teensy41/count.svg" style="height: 30px;width: 200px;"></a>
13+
814
---
915
---
1016

examples/AsyncUDPClient/AsyncUDPClient.ino

+13-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Async_UdpClient.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/
@@ -30,12 +30,12 @@ AsyncUDP udp;
3030
void sendRequest();
3131

3232
// Repeat forever, millis() resolution
33-
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
33+
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
3434

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

@@ -63,18 +63,22 @@ void parsePacket(AsyncUDPPacket packet)
6363
void setup()
6464
{
6565
Serial.begin(115200);
66+
6667
while (!Serial);
6768

68-
Serial.print("\nStart Async_UDPClient on "); Serial.println(BOARD_NAME);
69+
Serial.print("\nStart Async_UDPClient on ");
70+
Serial.println(BOARD_NAME);
6971
Serial.println(ASYNC_UDP_TEENSY41_VERSION);
7072

7173
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
74+
7275
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
7376
{
7477
Serial.print("Warning. Must use this example on Version equal or later than : ");
7578
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
7679
}
77-
#endif
80+
81+
#endif
7882

7983
delay(500);
8084

@@ -106,12 +110,13 @@ void setup()
106110
}
107111
else
108112
{
109-
Serial.print(F("Connected! IP address:")); Serial.println(Ethernet.localIP());
113+
Serial.print(F("Connected! IP address:"));
114+
Serial.println(Ethernet.localIP());
110115
}
111116

112117
#if USING_DHCP
113118
delay(1000);
114-
#else
119+
#else
115120
delay(2000);
116121
#endif
117122

examples/AsyncUDPClient/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/

examples/AsyncUDPMulticastServer/AsyncUDPMulticastServer.ino

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
AsyncUDPMulticastServer.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/
11-
11+
1212
#include "defines.h"
1313

1414
#define ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET "AsyncUDP_Teensy41 v1.2.1"
@@ -26,12 +26,12 @@ AsyncUDP udp;
2626
void sendRequest();
2727

2828
// Repeat forever, millis() resolution
29-
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
29+
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
3030

3131
void sendRequest()
3232
{
3333
UDP_LOGDEBUG("Send multicast");
34-
34+
3535
//Send multicast
3636
udp.print("Anyone here?");
3737
}
@@ -60,18 +60,22 @@ void parsePacket(AsyncUDPPacket packet)
6060
void setup()
6161
{
6262
Serial.begin(115200);
63+
6364
while (!Serial);
6465

65-
Serial.print("\nStart AsyncUDPMulticastServer on "); Serial.println(BOARD_NAME);
66+
Serial.print("\nStart AsyncUDPMulticastServer on ");
67+
Serial.println(BOARD_NAME);
6668
Serial.println(ASYNC_UDP_TEENSY41_VERSION);
6769

6870
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
71+
6972
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
7073
{
7174
Serial.print("Warning. Must use this example on Version equal or later than : ");
7275
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
7376
}
74-
#endif
77+
78+
#endif
7579

7680
delay(500);
7781

@@ -103,12 +107,13 @@ void setup()
103107
}
104108
else
105109
{
106-
Serial.print(F("Connected! IP address:")); Serial.println(Ethernet.localIP());
110+
Serial.print(F("Connected! IP address:"));
111+
Serial.println(Ethernet.localIP());
107112
}
108113

109114
#if USING_DHCP
110115
delay(1000);
111-
#else
116+
#else
112117
delay(2000);
113118
#endif
114119

examples/AsyncUDPMulticastServer/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/

examples/AsyncUDPServer/AsyncUDPServer.ino

+19-14
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Async_UdpServer.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/
@@ -26,30 +26,34 @@ AsyncUDP udp;
2626
void sendRequest();
2727

2828
// Repeat forever, millis() resolution
29-
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
29+
Ticker sendUDPRequest(sendRequest, UDP_REQUEST_INTERVAL_MS, 0, MILLIS);
3030

3131
void sendRequest()
3232
{
3333
UDP_LOGDEBUG("Send broadcast");
34-
34+
3535
udp.broadcast("Anyone here?");
3636
}
3737

3838
void setup()
3939
{
4040
Serial.begin(115200);
41+
4142
while (!Serial);
42-
43-
Serial.print("\nStart AsyncUDPServer on "); Serial.println(BOARD_NAME);
43+
44+
Serial.print("\nStart AsyncUDPServer on ");
45+
Serial.println(BOARD_NAME);
4446
Serial.println(ASYNC_UDP_TEENSY41_VERSION);
4547

4648
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
49+
4750
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
4851
{
4952
Serial.print("Warning. Must use this example on Version equal or later than : ");
5053
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
5154
}
52-
#endif
55+
56+
#endif
5357

5458
delay(500);
5559

@@ -81,21 +85,22 @@ void setup()
8185
}
8286
else
8387
{
84-
Serial.print(F("Connected! IP address:")); Serial.println(Ethernet.localIP());
88+
Serial.print(F("Connected! IP address:"));
89+
Serial.println(Ethernet.localIP());
8590
}
8691

8792
#if USING_DHCP
8893
delay(1000);
89-
#else
94+
#else
9095
delay(2000);
9196
#endif
92-
93-
if (udp.listen(1234))
97+
98+
if (udp.listen(1234))
9499
{
95100
Serial.print("UDP Listening on IP: ");
96101
Serial.println(Ethernet.localIP());
97-
98-
udp.onPacket([](AsyncUDPPacket packet)
102+
103+
udp.onPacket([](AsyncUDPPacket packet)
99104
{
100105
Serial.print("UDP Packet Type: ");
101106
Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast");
@@ -117,7 +122,7 @@ void setup()
117122
});
118123
}
119124

120-
sendRequest();
125+
sendRequest();
121126

122127
sendUDPRequest.start(); //start the ticker
123128
}

examples/AsyncUDPServer/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncUDP_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
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/AsyncUDP_Teensy41
1010
*****************************************************************************************************************************/

0 commit comments

Comments
 (0)