Skip to content

Commit

Permalink
tests/periph_pm: add command to display current blockers
Browse files Browse the repository at this point in the history
  • Loading branch information
benemorius committed Jun 22, 2019
1 parent 2933efb commit 3451bef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/periph_pm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ static int cmd_unblock(int argc, char **argv)
return 0;
}

static int cmd_pm(int argc, char **argv)
{
(void)argc;
(void)argv;

for (unsigned i = 0; i < PM_NUM_MODES; i++) {
printf("mode %d blockers: %d \n", i, pm_blocker.val_u8[i]);
}
return 0;
}

#ifdef MODULE_PERIPH_RTC
static int cmd_unblock_rtc(int argc, char **argv)
{
Expand Down Expand Up @@ -228,6 +239,7 @@ static const shell_command_t shell_commands[] = {
{ "off", "turn off", cmd_off },
{ "reboot", "reboot", cmd_reboot },
#ifdef MODULE_PM_LAYERED
{ "pm", "display current blockers for each power mode", cmd_pm },
{ "block", "block power mode", cmd_block },
{ "set", "set power mode", cmd_set },
{ "unblock", "unblock power mode", cmd_unblock },
Expand Down

0 comments on commit 3451bef

Please sign in to comment.