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

Add hardware-watchdog abstraction. #8

Merged
merged 5 commits into from
Feb 10, 2024
Merged

Conversation

floitsch
Copy link
Member

@floitsch floitsch commented Feb 9, 2024

No description provided.

That's a feature that was introduced in a later SDK version.
@floitsch floitsch requested a review from kasperl February 9, 2024 08:25
Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I think I prefer System over Hardware, but it is nice to have an abstraction for this so it can be tested better.

import log
import monitor
import system.services show ServiceProvider ServiceResource ServiceHandler
import .api.service
import .esp32 show HardwareWatchdogEsp32

interface HardwareWatchdog:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure hardware is a great name here given that this can be mocked, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed back to "system" (SystemWatchdog)

Copy link
Contributor

@kasperl kasperl left a comment

Choose a reason for hiding this comment

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

Looks even better!

Not sure if I missed more of the 'hardware' references...

src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
src/provider.toit Outdated Show resolved Hide resolved
floitsch and others added 2 commits February 10, 2024 11:30
@floitsch
Copy link
Member Author

Thanks. one reference to "hardware" was left.

@floitsch floitsch merged commit d7a9fa3 into main Feb 10, 2024
6 checks passed
@floitsch floitsch deleted the floitsch/fake-provider branch February 10, 2024 10:33
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.

2 participants