2014-09-24 00:49:17 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-11-20 13:34:00 +01:00
|
|
|
* @ingroup cpu_cortexm3_common
|
2014-09-24 00:49:17 +02:00
|
|
|
* @{
|
|
|
|
*
|
2014-11-20 13:34:00 +01:00
|
|
|
* @file
|
2014-09-24 00:49:17 +02:00
|
|
|
* @brief Implementation of the kernels reboot interface
|
|
|
|
*
|
|
|
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "arch/reboot_arch.h"
|
|
|
|
#include "cpu.h"
|
2014-11-20 13:37:36 +01:00
|
|
|
#include "hwtimer.h"
|
2014-09-24 00:49:17 +02:00
|
|
|
|
|
|
|
int reboot_arch(int mode)
|
|
|
|
{
|
|
|
|
printf("Going into reboot, mode %i\n", mode);
|
2014-11-20 13:37:36 +01:00
|
|
|
/* wait 1 ms to make sure the printf is finished */
|
|
|
|
hwtimer_wait(HWTIMER_TICKS(1000));
|
2014-09-24 00:49:17 +02:00
|
|
|
NVIC_SystemReset();
|
2014-11-20 13:36:00 +01:00
|
|
|
return -1;
|
2014-09-24 00:49:17 +02:00
|
|
|
}
|