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

Commit 7a93b66

Browse files
authored
Update README.md and use allman astyle
1 parent 9b46277 commit 7a93b66

File tree

10 files changed

+958
-753
lines changed

10 files changed

+958
-753
lines changed

CONTRIBUTING.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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-
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.13, Adafruit SAMD core v1.7.9, Seeed Studio SAMD v1.8.2)
18+
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.13, Adafruit SAMD core v1.7.11, Seeed Studio SAMD v1.8.3)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -29,10 +29,10 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.19
3030
Arduino SAMD Core Version 1.8.13
3131
OS: Ubuntu 20.04 LTS
32-
Linux kh-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
32+
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
3333
3434
Context:
35-
I encountered an endless loop while trying to connect to Local WiFi.
35+
I encountered a crash while using this library
3636
3737
Steps to reproduce:
3838
1. ...
@@ -41,12 +41,34 @@ Steps to reproduce:
4141
4. ...
4242
```
4343

44+
---
45+
4446
### Sending Feature Requests
4547

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

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

52+
---
53+
5054
### Sending Pull Requests
5155

5256
Pull Requests with changes and fixes are also welcome!
57+
58+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
59+
60+
1. Change directory to the library GitHub
61+
62+
```
63+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/MultiResetDetector_Generic_GitHub/
64+
xy@xy-Inspiron-3593:~/Arduino/xy/MultiResetDetector_Generic_GitHub$
65+
```
66+
67+
2. Issue astyle command
68+
69+
```
70+
xy@xy-Inspiron-3593:~/Arduino/xy/MultiResetDetector_Generic_GitHub$ bash utils/restyle.sh
71+
```
72+
73+
74+

README.md

+185-103
Large diffs are not rendered by default.

changelog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
## MultiResetDetector_Generic
1+
## MultiResetDetector_Generic Library
22

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

9+
10+
<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>
11+
<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>
12+
<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>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-MultiResetDetector_Generic/count.svg" title="MultiResetDetector_Generic Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-MultiResetDetector_Generic/count.svg" style="height: 30px;width: 200px;"></a>
14+
915
---
1016
---
1117

examples/checkWaitingMRD/checkWaitingMRD.ino

+13-11
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
To support ESP32, use ESP_DoubleResetDetector library from https://github.com/khoih-prog/ESP_DoubleResetDetector
4949
To support AVR, Teensy, SAM DUE, SAMD and STM32, etc., use this MultiResetDetector_Generic from //https://github.com/khoih-prog/MultiResetDetector_Generic
5050
*****************************************************************************************************************************/
51-
51+
5252
// These definitions must be placed before #include <MultiResetDetector_Generic.h> to be used
5353
// Otherwise, default values (MRD_TIMES = 3, MRD_TIMEOUT = 10 seconds and MRD_ADDRESS = 0) will be used
5454
// Number of subsequent resets during MRD_TIMEOUT to activate
@@ -67,7 +67,7 @@
6767
// Number of subsequent resets during MRD_TIMEOUT to activate
6868
#define MRD_TIMES 3
6969

70-
// Number of seconds after reset during which a
70+
// Number of seconds after reset during which a
7171
// subsequent reset will be considered a multi reset.
7272
#define MRD_TIMEOUT 10
7373

@@ -109,44 +109,46 @@ void check_status()
109109
{
110110
digitalWrite(LED_BUILTIN, LEDState);
111111

112-
LEDState = !LEDState;
112+
LEDState = !LEDState;
113113
}
114114
else
115115
{
116116
digitalWrite(LED_BUILTIN, LED_OFF);
117117
}
118-
118+
119119
checkstatus_timeout = current_millis + MRD_CHECK_INTERVAL;
120120
}
121121
}
122122

123123
void setup()
124124
{
125125
pinMode(LED_BUILTIN, OUTPUT);
126-
126+
127127
Serial.begin(115200);
128+
128129
while (!Serial);
129130

130131
delay(200);
131132

132133
#if defined(BOARD_NAME)
133-
Serial.print(F("\nStarting checkWaitingMRD on")); Serial.println(BOARD_NAME);
134+
Serial.print(F("\nStarting checkWaitingMRD on"));
135+
Serial.println(BOARD_NAME);
134136
#else
135137
Serial.print(F("\nStarting checkWaitingMRD"));
136-
#endif
138+
#endif
137139

138140
Serial.println(MULTIRESETDETECTOR_GENERIC_VERSION);
139141
Serial.println("-----------------------------------");
140-
142+
141143
mrd = new MultiResetDetector_Generic(MRD_TIMEOUT, MRD_ADDRESS);
142144

143-
if (mrd->detectMultiReset())
145+
if (mrd->detectMultiReset())
144146
{
145147
Serial.println("Multi Reset Detected");
146148
digitalWrite(LED_BUILTIN, LED_ON);
147149
MRD_Detected = true;
148-
}
149-
else
150+
}
151+
else
150152
{
151153
Serial.println("No Multi Reset Detected");
152154
digitalWrite(LED_BUILTIN, LED_OFF);

examples/minimal/minimal.ino

+7-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
// Number of subsequent resets during MRD_TIMEOUT to activate
5656
#define MRD_TIMES 5
5757

58-
// Number of seconds after reset during which a
58+
// Number of seconds after reset during which a
5959
// subsequent reset will be considered a multi reset.
6060
#define MRD_TIMEOUT 10
6161

@@ -75,12 +75,14 @@ void setup()
7575
pinMode(LED_BUILTIN, OUTPUT);
7676

7777
Serial.begin(115200);
78+
7879
while (!Serial);
7980

8081
Serial.println();
8182

8283
#if defined(BOARD_NAME)
83-
Serial.print(F("MultiResetDetector minimal Example Program on ")); Serial.println(BOARD_NAME);
84+
Serial.print(F("MultiResetDetector minimal Example Program on "));
85+
Serial.println(BOARD_NAME);
8486
#else
8587
Serial.println(F("MultiResetDetector minimal Example Program"));
8688
#endif
@@ -90,12 +92,12 @@ void setup()
9092

9193
mrd = new MultiResetDetector_Generic(MRD_TIMEOUT, MRD_ADDRESS);
9294

93-
if (mrd->detectMultiReset())
95+
if (mrd->detectMultiReset())
9496
{
9597
Serial.println(F("Multi Reset Detected"));
9698
digitalWrite(LED_BUILTIN, LOW);
97-
}
98-
else
99+
}
100+
else
99101
{
100102
Serial.println(F("No Multi Reset Detected"));
101103
digitalWrite(LED_BUILTIN, HIGH);

platformio/platformio.ini

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ upload_speed = 921600
3737

3838
; Checks for the compatibility with frameworks and dev/platforms
3939
lib_compat_mode = strict
40+
lib_ldf_mode = chain+
41+
;lib_ldf_mode = deep+
4042

4143
lib_deps =
4244
; PlatformIO 4.x

0 commit comments

Comments
 (0)