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

Commit

Permalink
Update README.md and use allman astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
khoih-prog committed Nov 25, 2022
1 parent 9b46277 commit 7a93b66
Show file tree
Hide file tree
Showing 10 changed files with 958 additions and 753 deletions.
28 changes: 25 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
Please ensure to specify the following:

* Arduino IDE version (e.g. 1.8.19) or Platform.io version
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.13, Adafruit SAMD core v1.7.9, Seeed Studio SAMD v1.8.2)
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.13, Adafruit SAMD core v1.7.11, Seeed Studio SAMD v1.8.3)
* Contextual information (e.g. what you were trying to achieve)
* Simplest possible steps to reproduce
* Anything that might be relevant in your opinion, such as:
Expand All @@ -29,10 +29,10 @@ Please ensure to specify the following:
Arduino IDE version: 1.8.19
Arduino SAMD Core Version 1.8.13
OS: Ubuntu 20.04 LTS
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
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
Context:
I encountered an endless loop while trying to connect to Local WiFi.
I encountered a crash while using this library
Steps to reproduce:
1. ...
Expand All @@ -41,12 +41,34 @@ Steps to reproduce:
4. ...
```

---

### Sending Feature Requests

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

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.

---

### Sending Pull Requests

Pull Requests with changes and fixes are also welcome!

Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)

1. Change directory to the library GitHub

```
xy@xy-Inspiron-3593:~$ cd Arduino/xy/MultiResetDetector_Generic_GitHub/
xy@xy-Inspiron-3593:~/Arduino/xy/MultiResetDetector_Generic_GitHub$
```

2. Issue astyle command

```
xy@xy-Inspiron-3593:~/Arduino/xy/MultiResetDetector_Generic_GitHub$ bash utils/restyle.sh
```



288 changes: 185 additions & 103 deletions README.md

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
## MultiResetDetector_Generic
## MultiResetDetector_Generic Library

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


<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>
<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>
<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>
<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>

---
---

Expand Down
24 changes: 13 additions & 11 deletions examples/checkWaitingMRD/checkWaitingMRD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
To support ESP32, use ESP_DoubleResetDetector library from https://github.com/khoih-prog/ESP_DoubleResetDetector
To support AVR, Teensy, SAM DUE, SAMD and STM32, etc., use this MultiResetDetector_Generic from //https://github.com/khoih-prog/MultiResetDetector_Generic
*****************************************************************************************************************************/

// These definitions must be placed before #include <MultiResetDetector_Generic.h> to be used
// Otherwise, default values (MRD_TIMES = 3, MRD_TIMEOUT = 10 seconds and MRD_ADDRESS = 0) will be used
// Number of subsequent resets during MRD_TIMEOUT to activate
Expand All @@ -67,7 +67,7 @@
// Number of subsequent resets during MRD_TIMEOUT to activate
#define MRD_TIMES 3

// Number of seconds after reset during which a
// Number of seconds after reset during which a
// subsequent reset will be considered a multi reset.
#define MRD_TIMEOUT 10

Expand Down Expand Up @@ -109,44 +109,46 @@ void check_status()
{
digitalWrite(LED_BUILTIN, LEDState);

LEDState = !LEDState;
LEDState = !LEDState;
}
else
{
digitalWrite(LED_BUILTIN, LED_OFF);
}

checkstatus_timeout = current_millis + MRD_CHECK_INTERVAL;
}
}

void setup()
{
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);

while (!Serial);

delay(200);

#if defined(BOARD_NAME)
Serial.print(F("\nStarting checkWaitingMRD on")); Serial.println(BOARD_NAME);
Serial.print(F("\nStarting checkWaitingMRD on"));
Serial.println(BOARD_NAME);
#else
Serial.print(F("\nStarting checkWaitingMRD"));
#endif
#endif

Serial.println(MULTIRESETDETECTOR_GENERIC_VERSION);
Serial.println("-----------------------------------");

mrd = new MultiResetDetector_Generic(MRD_TIMEOUT, MRD_ADDRESS);

if (mrd->detectMultiReset())
if (mrd->detectMultiReset())
{
Serial.println("Multi Reset Detected");
digitalWrite(LED_BUILTIN, LED_ON);
MRD_Detected = true;
}
else
}
else
{
Serial.println("No Multi Reset Detected");
digitalWrite(LED_BUILTIN, LED_OFF);
Expand Down
12 changes: 7 additions & 5 deletions examples/minimal/minimal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// Number of subsequent resets during MRD_TIMEOUT to activate
#define MRD_TIMES 5

// Number of seconds after reset during which a
// Number of seconds after reset during which a
// subsequent reset will be considered a multi reset.
#define MRD_TIMEOUT 10

Expand All @@ -75,12 +75,14 @@ void setup()
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);

while (!Serial);

Serial.println();

#if defined(BOARD_NAME)
Serial.print(F("MultiResetDetector minimal Example Program on ")); Serial.println(BOARD_NAME);
Serial.print(F("MultiResetDetector minimal Example Program on "));
Serial.println(BOARD_NAME);
#else
Serial.println(F("MultiResetDetector minimal Example Program"));
#endif
Expand All @@ -90,12 +92,12 @@ void setup()

mrd = new MultiResetDetector_Generic(MRD_TIMEOUT, MRD_ADDRESS);

if (mrd->detectMultiReset())
if (mrd->detectMultiReset())
{
Serial.println(F("Multi Reset Detected"));
digitalWrite(LED_BUILTIN, LOW);
}
else
}
else
{
Serial.println(F("No Multi Reset Detected"));
digitalWrite(LED_BUILTIN, HIGH);
Expand Down
2 changes: 2 additions & 0 deletions platformio/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ upload_speed = 921600

; Checks for the compatibility with frameworks and dev/platforms
lib_compat_mode = strict
lib_ldf_mode = chain+
;lib_ldf_mode = deep+

lib_deps =
; PlatformIO 4.x
Expand Down
Loading

0 comments on commit 7a93b66

Please sign in to comment.