From 7ad4a7402fc6bbda15ec0d11d75ea61362c2de8a Mon Sep 17 00:00:00 2001 From: James Foster Date: Thu, 8 Jul 2021 12:47:19 -0700 Subject: [PATCH 1/2] Add `avr/wdt.h` and simple test that ensures the header can be found and the functions can be called. --- CHANGELOG.md | 1 + SampleProjects/TestSomething/test/wdt.cpp | 12 ++++++++++++ cpp/arduino/avr/wdt.h | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 SampleProjects/TestSomething/test/wdt.cpp create mode 100644 cpp/arduino/avr/wdt.h diff --git a/CHANGELOG.md b/CHANGELOG.md index f29be1a6..5da22856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Better indications of the build phases in the test runner `arduino_ci.rb` - Better indications of which example sketch is being compiled as part of testing +- Allow use of watchdog timer in application code (though it doesn't do anything) ### Changed - Topmost installtion instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README. diff --git a/SampleProjects/TestSomething/test/wdt.cpp b/SampleProjects/TestSomething/test/wdt.cpp new file mode 100644 index 00000000..a037363c --- /dev/null +++ b/SampleProjects/TestSomething/test/wdt.cpp @@ -0,0 +1,12 @@ +#include +#include +#include + +unittest(wdt) { + wdt_disable(); + wdt_enable(WDTO_8S); + wdt_reset(); + assertTrue(true); +} + +unittest_main() diff --git a/cpp/arduino/avr/wdt.h b/cpp/arduino/avr/wdt.h new file mode 100644 index 00000000..ab489f6b --- /dev/null +++ b/cpp/arduino/avr/wdt.h @@ -0,0 +1,16 @@ +// Stub for testing that doesn't do anything (but at least compiles!) + +#define wdt_disable() (void)0 +#define wdt_enable(timeout) (void)0 +#define wdt_reset() (void)0 + +#define WDTO_15MS 0 +#define WDTO_30MS 1 +#define WDTO_60MS 2 +#define WDTO_120MS 3 +#define WDTO_250MS 4 +#define WDTO_500MS 5 +#define WDTO_1S 6 +#define WDTO_2S 7 +#define WDTO_4S 8 +#define WDTO_8S 9 From ef70223d3e4f1c4f1dd33bfd3154aca854a6f028 Mon Sep 17 00:00:00 2001 From: James Foster Date: Fri, 27 Aug 2021 15:02:05 -0700 Subject: [PATCH 2/2] Move CHANGELOG.md comment to unreleased. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5da22856..cf60dfbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added +- Allow use of watchdog timer in application code (though it doesn't do anything) ### Changed - Change 266 files from CRLF to LF. @@ -24,7 +25,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Better indications of the build phases in the test runner `arduino_ci.rb` - Better indications of which example sketch is being compiled as part of testing -- Allow use of watchdog timer in application code (though it doesn't do anything) ### Changed - Topmost installtion instructions now suggest `gem install arduino_ci` instead of using a `Gemfile`. Reasons for using a `Gemfile` are listed and discussed separately further down the README.