[riot-notifications] [RIOT-OS/RIOT] tests/periph_pm: make usage more intuitive (#11731)

Thomas Stilwell notifications at github.com
Sat Jun 22 05:33:16 CEST 2019


### Contribution description
Using tests/periph_pm can be unintuitive if you aren't already very familiar with the PM subsystem. I identified and addressed two specific causes and I think this greatly improves the situation.
1. there is no way to see which modes are currently blocked or unblocked
1. unblocking an already-unblocked mode triggers an assertion failure and kernel panic which can make the user think there's some serious problem when really there is no problem

This PR addresses 1) by adding a new command `pm` to view blockers and 2) by adding a check to print a friendly error message when unblocking an unblocked mode.

### Testing procedure
```shell
> pm
mode 0 blockers: 1 
mode 1 blockers: 0 
mode 2 blockers: 0 
mode 3 blockers: 0 
> unblock 2
Mode 2 is already unblocked.
1 >
```


### Issues/PRs references
I think some confusion earlier in #7897 can be avoided with these changes.
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11731

-- Commit Summary --

  * tests/periph_pm: print error instead of allowing assertion failure
  * tests/periph_pm: add command to display current blockers

-- File Changes --

    M tests/periph_pm/main.c (29)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11731.patch
https://github.com/RIOT-OS/RIOT/pull/11731.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11731
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190621/3e0bd47e/attachment.html>


More information about the notifications mailing list