2014-07-15 12:09:50 +02:00
|
|
|
/*
|
2015-09-29 13:41:33 +02:00
|
|
|
* Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
* 2014 Freie Universität Berlin, Hinnerk van Bruinehsen
|
2014-07-15 12:09:50 +02:00
|
|
|
*
|
|
|
|
* 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_atmega2560
|
|
|
|
* @{
|
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2014-07-15 12:09:50 +02:00
|
|
|
* @brief Implementation of the kernels reboot interface
|
|
|
|
*
|
|
|
|
* @author Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
|
2015-09-29 13:41:33 +02:00
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
2014-07-15 12:09:50 +02:00
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <avr/wdt.h>
|
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
|
2015-09-29 13:41:33 +02:00
|
|
|
void reboot(void)
|
2014-07-15 12:09:50 +02:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Since the AVR doesn't support a real software reset, we set the Watchdog
|
|
|
|
* Timer on a 250ms timeout. Consider this a kludge.
|
|
|
|
*/
|
|
|
|
wdt_enable(WDTO_250MS);
|
2015-09-29 13:41:33 +02:00
|
|
|
while(1);
|
2014-07-15 12:09:50 +02:00
|
|
|
}
|