Skip to content

Allow compiling with Watchdog Timer calls #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions SampleProjects/TestSomething/test/wdt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <Arduino.h>
#include <ArduinoUnitTests.h>
#include <avr/wdt.h>

unittest(wdt) {
wdt_disable();
wdt_enable(WDTO_8S);
wdt_reset();
assertTrue(true);
}

unittest_main()
16 changes: 16 additions & 0 deletions cpp/arduino/avr/wdt.h
Original file line number Diff line number Diff line change
@@ -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