Skip to content

Add WDT and sleep functions to RP2040 Helper #862

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 5 commits into from
Sep 22, 2022

Conversation

brentru
Copy link
Contributor

@brentru brentru commented Sep 20, 2022

Addresses and resolves #861 by adding two function helpers for basic hardware watchdog access and one function for entering low-power sleep (WFE) mode.

cc @earlephilhower

Remove deleted sleep_until_ms docs
Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@brentru
Copy link
Contributor Author

brentru commented Sep 21, 2022

@earlephilhower Sweet! Could you create a release when merged? Need this as a dependency for Adafruit_SleepyDog.

@earlephilhower
Copy link
Owner

Looks like a typo in the feed-the-watchdog call. Can you please update?

I'll do a new drop tonight once this is in and I get the Cytron SPI1 change done.

@brentru
Copy link
Contributor Author

brentru commented Sep 21, 2022

Missed that, thanks. Was in my local pico BSP but not upstream.

}

void wdt_reset() {
watchdog_reboot();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, don't you mean watchdog_update()? This call should also fail because it actually resets the chip (see the RP2040::reboot() method in this file) and needs add'l params.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, should be watchdog_update (https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__watchdog.html#ga329b748919954f8b48c58049115a5c54), to reload the counter with the specified time, not reset it.

@earlephilhower earlephilhower merged commit 4e77ee0 into earlephilhower:master Sep 22, 2022
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

Successfully merging this pull request may close these issues.

Watchdog timer support?
2 participants