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

allow reconfiguring a running watchdog #12511

Merged
merged 3 commits into from
Mar 3, 2020

Conversation

paul-szczepanek-arm
Copy link
Member

Summary of changes

Calling Watchdog::start is limited to only configuring a stopped watchdog. There is no need for such a restriction. The driver checks an internal state and disallows the call. The ports allow configuring a running watchdog. If a port does not allow such a call the call will return an error. No need to preemptively disallow it. The hal call specifies the call can made repeatedly without stopping.

Impact of changes

Migration actions required

Documentation

The docs are already correct as they don't mention any requirement for watchdog to be stopped. This fix will bring the actual behaviour in line with them.


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@bulislaw

Copy link
Member

@bulislaw bulislaw 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, but I think we need to clarify the docs a bit:

    /** Start the Watchdog timer.
     *
     * @note Asset that the timeout param is supported by the target
     * (0 < timeout <= Watchdog::get_max_timeout).
     *
     * @param timeout Watchdog timeout in milliseconds.
     *
     * @return true if the Watchdog timer was started successfully;
     *         false if Watchdog timer was not started or if the Watchdog
     *         timer is already running.
     */
    bool start(uint32_t timeout);

fore return False if Watchdog timer was not started or if the Watchdog timer is already running. Should probably say that it's false when the timer wasn't started or it setting new timeout wasn't possible.

@mergify mergify bot added the needs: work label Feb 25, 2020
@mergify mergify bot dismissed bulislaw’s stale review February 26, 2020 11:11

Pull request has been modified.

0xc0170
0xc0170 previously approved these changes Feb 27, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2020

Ci started

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2020

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2020

@paul-szczepanek-arm Unittest failed for Watchdog - please review

@paul-szczepanek-arm
Copy link
Member Author

looks like the unit test is testing the assumption that I'm trying to remove

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 2, 2020

In that case, fix the unit test as well and document the behavior (already done here).

@mergify mergify bot dismissed 0xc0170’s stale review March 2, 2020 10:54

Pull request has been modified.

@paul-szczepanek-arm
Copy link
Member Author

removed the part of the test that tests that assumption

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 2, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Mar 2, 2020

Test run: SUCCESS

Summary: 7 of 7 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit a937d30 into ARMmbed:master Mar 3, 2020
@mergify mergify bot removed the ready for merge label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants