Skip to content
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

[Feature request] Interfaces for the watchdog reset status flag and ISR #29

Open
serjche opened this issue Aug 17, 2020 · 0 comments
Open

Comments

@serjche
Copy link

serjche commented Aug 17, 2020

Hi,

I'm not quite sure if this is the right place for feature requests, but here we go.

I'd be very cool to have an interface in the WatchdogType classes to see the status of the watchdog reset, given the use case when the reset has occurred and would want to do something with this information at system startup, either log it internally, send information to the serial interface, or do some checks after that.

This is very common on systems that run constantly 24/7, where you may want to know if any watchdog resets have occurred.

I'm using the atmega2560, and it would be as simple as checking the MCUSR register flag, but it would kinda defeat the purpose of having an encapsulated interface such as this.

On the other hand, another useful interface would be access to a callback of the ISR of the watchdog, maybe as a __weak symbol, function pointer or a normal function, to be able to do cleanup tasks before the reset of the system occurs.

I know the real challenge of this would be to generalize across all different boards and architectures supported.

Let me know if this would be a feature of interest, I might be able to help on a pull request, although I only have the atmega2560 to test it on.

Thanks!

  • Arduino board: Arduino Mega 2560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant