mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
Merge pull request #6348 from haukepetersen/opt_pm_nrf
cpu/nrf5x: unified pm.c
This commit is contained in:
commit
06da507c2f
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
* 2016 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_nrf52
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Implementation of the kernels power management interface
|
||||
*
|
||||
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "periph/pm.h"
|
||||
#include "cpu.h"
|
||||
|
||||
void pm_off(void)
|
||||
{
|
||||
NRF_POWER->SYSTEMOFF = 1;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Kaspar Schleiser <kaspar@schleiser.de>
|
||||
* 2014 Freie Universität Berlin
|
||||
* 2014-2017 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
|
||||
@ -8,11 +8,11 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup cpu_nrf51
|
||||
* @ingroup cpu_nrf5x_common
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Implementation of the kernels power management interface
|
||||
* @brief NRF5x specific power management implementations
|
||||
*
|
||||
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
@ -20,11 +20,18 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "periph/pm.h"
|
||||
#include "cpu.h"
|
||||
|
||||
void pm_off(void)
|
||||
{
|
||||
#ifdef CPU_FAM_NRF51
|
||||
NRF_POWER->RAMON = 0;
|
||||
#else
|
||||
for (int i = 0; i < 8; i++) {
|
||||
NRF_POWER->RAM[i].POWERCLR = (POWER_RAM_POWERCLR_S1RETENTION_Msk |
|
||||
POWER_RAM_POWERCLR_S0RETENTION_Msk);
|
||||
}
|
||||
#endif
|
||||
NRF_POWER->SYSTEMOFF = 1;
|
||||
while(1) {}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user