mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #20523 from MrKevinWeiss/pr/guard_shell_pm
core|sys: Guard periph_pm calls
This commit is contained in:
commit
93b05d5dc4
@ -81,7 +81,7 @@ static void *main_trampoline(void *arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (IS_ACTIVE(CONFIG_CORE_EXIT_WITH_MAIN)) {
|
||||
if (IS_ACTIVE(CONFIG_CORE_EXIT_WITH_MAIN) && IS_USED(MODULE_PERIPH_PM)) {
|
||||
pm_off();
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,9 @@ __attribute__((used)) void _fini(void)
|
||||
__attribute__((used)) void _exit(int n)
|
||||
{
|
||||
LOG_INFO("#! exit %i: powering off\n", n);
|
||||
#ifdef MODULE_PERIPH_PM
|
||||
pm_off();
|
||||
#endif
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,9 @@ void __attribute__((__noreturn__))
|
||||
_exit(int n)
|
||||
{
|
||||
LOG_INFO("#! exit %i: powering off\n", n);
|
||||
#ifdef MODULE_PERIPH_PM
|
||||
pm_off();
|
||||
#endif /* MODULE_PERIPH_PM */
|
||||
for (;;) {
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "riotboot/slot.h"
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_PERIPH_PM
|
||||
static int _reboot_handler(int argc, char **argv)
|
||||
{
|
||||
(void) argc;
|
||||
@ -41,6 +42,7 @@ static int _reboot_handler(int argc, char **argv)
|
||||
}
|
||||
|
||||
SHELL_COMMAND(reboot, "Reboot the node", _reboot_handler);
|
||||
#endif /* MODULE_PERIPH_PM */
|
||||
|
||||
#ifdef MODULE_USB_BOARD_RESET
|
||||
static int _bootloader_handler(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user