diff --git a/CHANGELOG.md b/CHANGELOG.md index da0b8e45..7e7173f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,17 +7,18 @@ 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) - Show output from successful compile - `--min-free-space=N` command-line argument to fail if free space is below requred value +- Add `_BV()` macro. ### Changed - Fix copy/paste error to allow additional warnings for a platform - Properly report compile errors in GitHub Actions (#296) - Put build artifacts in a separate directory to reduce clutter. -- Change 266 files from CRLF to LF. -- Add `_BV()` macro. - Replace `#define yield() _NOP()` with `inline void yield() { _NOP(); }` so that other code can define a `yield()` function. - Update .gitattributes so we have consistent line endings +- Change 266 files from CRLF to LF. - Run tests on push as well as on a pull request so developers can see impact ### Deprecated 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