1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu: mips_pic32_common: Implement pm_reboot

Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
This commit is contained in:
Francois Berder 2020-01-10 18:04:40 +00:00
parent 847fedc754
commit cbb0247f26

View File

@ -0,0 +1,38 @@
/*
* Copyright 2020 Francois Berder
*
* 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_mips_pic32_common
* @ingroup drivers_periph_pm
* @{
*
* @file
* @brief common periph/pm functions
*
* @author Francois Berder <fberder@outlook.fr >
*
* @}
*/
#include "periph/pm.h"
void pm_reboot(void)
{
/* Unlock OSCCON */
SYSKEY = 0x00000000;
SYSKEY = 0xAA996655;
SYSKEY = 0x556699AA;
/* Set SWRST bit to arm reset */
RSWRSTSET = 1;
/* Read RSWRST register to trigger reset */
RSWRST;
while(1);
}