1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/periph_pm: print current PM blockers on startup

This commit is contained in:
Thomas Stilwell 2019-06-22 17:30:22 -07:00 committed by Alexandre Abadie
parent 100390cdca
commit 90579e81c9
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 9 additions and 0 deletions

View File

@ -8,5 +8,6 @@ FEATURES_OPTIONAL += periph_rtc
FEATURES_OPTIONAL += periph_gpio_irq
USEMODULE += shell
USEMODULE += shell_commands
include $(RIOTBASE)/Makefile.include

View File

@ -32,6 +32,7 @@
#include "periph/rtc.h"
#endif
#include "pm_layered.h"
extern int _pm(int argc, char **argv);
#endif
#include "shell.h"
@ -270,6 +271,13 @@ int main(void)
"save more power, but may require an event/interrupt to wake up\n"
"the CPU. Reset the CPU if needed.\n",
PM_NUM_MODES - 1);
/* In case the system boots into an unresponsive shell, at least display
* the state of PM blockers so that the user will know which power mode has
* been entered and is presumably responsible for the unresponsive shell.
*/
_pm(2, (char *[]){"pm", "show"});
#else
puts("This application allows you to test the CPU power management.\n"
"Layered support is not unavailable for this CPU. Reset the CPU if\n"