From d0301dfa342ed75970f9f39a36e0da5e8d5754ac Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 13 Jan 2017 10:17:15 +0100 Subject: [PATCH 1/3] sys/newlib+shell: use pm_reboot() for reboot() --- sys/newlib/syscalls.c | 4 ++-- sys/shell/commands/sc_sys.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/newlib/syscalls.c b/sys/newlib/syscalls.c index 23da5ac55b..3489e36c01 100644 --- a/sys/newlib/syscalls.c +++ b/sys/newlib/syscalls.c @@ -36,9 +36,9 @@ #include "board.h" #include "sched.h" #include "thread.h" -#include "reboot.h" #include "irq.h" #include "log.h" +#include "periph/pm.h" #include "uart_stdio.h" @@ -83,7 +83,7 @@ __attribute__((used)) void _fini(void) void _exit(int n) { LOG_INFO("#! exit %i: resetting\n", n); - reboot(); + pm_reboot(); while(1); } diff --git a/sys/shell/commands/sc_sys.c b/sys/shell/commands/sc_sys.c index 1aa02b3ce2..f14d09392e 100644 --- a/sys/shell/commands/sc_sys.c +++ b/sys/shell/commands/sc_sys.c @@ -18,14 +18,14 @@ * @} */ -#include "reboot.h" +#include "periph/pm.h" int _reboot_handler(int argc, char **argv) { (void) argc; (void) argv; - reboot(); + pm_reboot(); return 0; } From a7502355b8f456b4d160e278d4209975798e28d4 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 13 Jan 2017 10:16:34 +0100 Subject: [PATCH 2/3] core: remove reboot.h with the new PM, the reboot.h is deprecated and pm_reboot() from periph/pm.h should be used. --- core/include/reboot.h | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 core/include/reboot.h diff --git a/core/include/reboot.h b/core/include/reboot.h deleted file mode 100644 index 6a1f879a39..0000000000 --- a/core/include/reboot.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2016 Kaspar Schleiser - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup core_internal - * @{ - * - * @file - * @brief Reboot function - * - * @author Kaspar Schleiser - */ - -#ifndef REBOOT_H_ -#define REBOOT_H_ - -#include "periph/pm.h" - -#ifdef __cplusplus - extern "C" { -#endif - -/** - * @brief Immediately reboots the system. - * - * This function is used by core_panic() when the DEVELHELP macro is not defined. - */ -static inline void reboot(void) -{ - pm_reboot(); -} - -#ifdef __cplusplus -} -#endif - -#endif /* REBOOT_H_ */ -/** @} */ From 8c7f2d3e9dea6f3115dc6597832d7aa1fe0e06a2 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 13 Jan 2017 11:01:02 +0100 Subject: [PATCH 3/3] s syscalls: use pm_off for _exit() --- sys/newlib/syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/newlib/syscalls.c b/sys/newlib/syscalls.c index 3489e36c01..a90d54c0ba 100644 --- a/sys/newlib/syscalls.c +++ b/sys/newlib/syscalls.c @@ -82,8 +82,8 @@ __attribute__((used)) void _fini(void) */ void _exit(int n) { - LOG_INFO("#! exit %i: resetting\n", n); - pm_reboot(); + LOG_INFO("#! exit %i: powering off\n", n); + pm_off(); while(1); }