diff --git a/cpu/cc2538/reboot_arch.c b/cpu/cortex-m0_common/reboot_arch.c similarity index 75% rename from cpu/cc2538/reboot_arch.c rename to cpu/cortex-m0_common/reboot_arch.c index cb22deeec8..4774572398 100644 --- a/cpu/cc2538/reboot_arch.c +++ b/cpu/cortex-m0_common/reboot_arch.c @@ -7,10 +7,10 @@ */ /** - * @ingroup cpu_cc2538 + * @ingroup cpu_cortexm0_common * @{ * - * @file reboot_arch.c + * @file * @brief Implementation of the kernels reboot interface * * @author Hauke Petersen @@ -22,13 +22,13 @@ #include "arch/reboot_arch.h" #include "cpu.h" - +#include "hwtimer.h" int reboot_arch(int mode) { printf("Going into reboot, mode %i\n", mode); - + /* wait 1 ms to make sure the printf is finished */ + hwtimer_wait(HWTIMER_TICKS(1000)); NVIC_SystemReset(); - - return 0; + return -1; } diff --git a/cpu/sam3x8e/reboot_arch.c b/cpu/cortex-m3_common/reboot_arch.c similarity index 75% rename from cpu/sam3x8e/reboot_arch.c rename to cpu/cortex-m3_common/reboot_arch.c index 6d61335b51..fc6046c855 100644 --- a/cpu/sam3x8e/reboot_arch.c +++ b/cpu/cortex-m3_common/reboot_arch.c @@ -7,10 +7,10 @@ */ /** - * @ingroup cpu_sam3x8e + * @ingroup cpu_cortexm3_common * @{ * - * @file reboot_arch.c + * @file * @brief Implementation of the kernels reboot interface * * @author Hauke Petersen @@ -22,13 +22,13 @@ #include "arch/reboot_arch.h" #include "cpu.h" - +#include "hwtimer.h" int reboot_arch(int mode) { printf("Going into reboot, mode %i\n", mode); - + /* wait 1 ms to make sure the printf is finished */ + hwtimer_wait(HWTIMER_TICKS(1000)); NVIC_SystemReset(); - - return 0; + return -1; } diff --git a/cpu/samd21/reboot_arch.c b/cpu/cortex-m4_common/reboot_arch.c similarity index 67% rename from cpu/samd21/reboot_arch.c rename to cpu/cortex-m4_common/reboot_arch.c index a6fc0c9589..174a6a5cce 100644 --- a/cpu/samd21/reboot_arch.c +++ b/cpu/cortex-m4_common/reboot_arch.c @@ -7,13 +7,13 @@ */ /** - * @ingroup cpu_samd21 + * @ingroup cpu_cortexm4_common * @{ * - * @file reboot_arch.c + * @file * @brief Implementation of the kernels reboot interface * - * @author Thomas Eichinger + * @author Hauke Petersen * * @} */ @@ -22,13 +22,13 @@ #include "arch/reboot_arch.h" #include "cpu.h" - +#include "hwtimer.h" int reboot_arch(int mode) { printf("Going into reboot, mode %i\n", mode); - + /* wait 1 ms to make sure the printf is finished */ + hwtimer_wait(HWTIMER_TICKS(1000)); NVIC_SystemReset(); - - return 0; + return -1; } diff --git a/cpu/nrf51822/reboot_arch.c b/cpu/nrf51822/reboot_arch.c deleted file mode 100644 index 08bbdfd85c..0000000000 --- a/cpu/nrf51822/reboot_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * 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. - */ - -/** - * @ingroup cpu_nrf51822 - * @{ - * - * @file - * @brief Implementation of the kernels reboot interface - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "arch/reboot_arch.h" -#include "cpu.h" - - -int reboot_arch(int mode) -{ - printf("Going into reboot, mode %i\n", mode); - - NVIC_SystemReset(); - - return 0; -} diff --git a/cpu/stm32f0/reboot_arch.c b/cpu/stm32f0/reboot_arch.c deleted file mode 100644 index 2b249606a7..0000000000 --- a/cpu/stm32f0/reboot_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * 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. - */ - -/** - * @ingroup cpu_stm32f0 - * @{ - * - * @file - * @brief Implementation of the kernels reboot interface - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "arch/reboot_arch.h" -#include "cpu.h" - - -int reboot_arch(int mode) -{ - printf("Going into reboot, mode %i\n", mode); - - NVIC_SystemReset(); - - return 0; -} diff --git a/cpu/stm32f1/reboot_arch.c b/cpu/stm32f1/reboot_arch.c deleted file mode 100644 index a294513d9c..0000000000 --- a/cpu/stm32f1/reboot_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * 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. - */ - -/** - * @ingroup cpu_stm32f1 - * @{ - * - * @file reboot_arch.c - * @brief Implementation of the kernels reboot interface - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "arch/reboot_arch.h" -#include "cpu.h" - - -int reboot_arch(int mode) -{ - printf("Going into reboot, mode %i\n", mode); - - NVIC_SystemReset(); - - return 0; -} diff --git a/cpu/stm32f3/reboot_arch.c b/cpu/stm32f3/reboot_arch.c deleted file mode 100644 index 7d994496b1..0000000000 --- a/cpu/stm32f3/reboot_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * 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. - */ - -/** - * @ingroup cpu_stm32f3 - * @{ - * - * @file - * @brief Implementation of the kernels reboot interface - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "arch/reboot_arch.h" -#include "cpu.h" - - -int reboot_arch(int mode) -{ - printf("Going into reboot, mode %i\n", mode); - - NVIC_SystemReset(); - - return 0; -} diff --git a/cpu/stm32f4/reboot_arch.c b/cpu/stm32f4/reboot_arch.c deleted file mode 100644 index 4ce60cb5cd..0000000000 --- a/cpu/stm32f4/reboot_arch.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin - * - * 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. - */ - -/** - * @ingroup cpu_stm32f4 - * @{ - * - * @file - * @brief Implementation of the kernels reboot interface - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "arch/reboot_arch.h" -#include "cpu.h" - - -int reboot_arch(int mode) -{ - printf("Going into reboot, mode %i\n", mode); - - NVIC_SystemReset(); - - return 0; -}