Merge pull request #6344 from haukepetersen/opt_pm_misc

pm: misc cleanup and fixes
This commit is contained in:
Kaspar Schleiser 2017-01-24 14:07:36 +01:00 committed by GitHub
commit d1db946188
21 changed files with 85 additions and 34 deletions

View File

@ -10,4 +10,3 @@ export FFLAGS = rf2500 "prog $(HEXFILE)"
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/drivers/include
USEMODULE += chronos-drivers
USEMODULE += periph_common

View File

@ -1,2 +1,5 @@
CFLAGS += $(CFLAGS_BASIC)
DIRS = periph
include $(RIOTBASE)/Makefile.base

View File

@ -1,4 +1,6 @@
# Target architecture for the build. Use arm-none-eabi if you are unsure.
export TARGET_ARCH ?= arm-none-eabi
USEMODULE += arm7_common_periph
INCLUDES += -I$(RIOTBASE)/cpu/arm7_common/include/

View File

@ -106,10 +106,3 @@ void thread_print_stack(void)
printf("STACK (%d)= %X \n", i, *s);
}
void pm_reboot(void)
{
while (1) {
arm_reset();
}
}

View File

@ -0,0 +1,3 @@
MODULE = arm7_common_periph
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,29 @@
/*
* Copyright (C) 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
* directory for more details.
*/
/**
* @ingroup cpu_arm7_common
* @{
*
* @file
* @brief ARM7 common periph/pm functions
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include "arm_cpu.h"
void pm_reboot(void)
{
while (1) {
arm_reset();
}
}

View File

@ -2,4 +2,4 @@ INCLUDES += -I$(RIOTBASE)/cpu/cc430/include/
include $(RIOTCPU)/msp430_common/Makefile.include
export USEMODULE += periph
export USEMODULE += periph periph_common

View File

@ -2,4 +2,6 @@
# optimization. see #5774.
SRC_NOLTO += thread_arch.c
DIRS = periph
include $(RIOTBASE)/Makefile.base

View File

@ -1,2 +1,4 @@
# include module specific includes
export INCLUDES += -I$(RIOTCPU)/cortexm_common/include
USEMODULE += cortexm_common_periph

View File

@ -23,10 +23,6 @@
#include "cpu.h"
#include "log.h"
#ifdef FEATURE_PERIPH_PM
#include "periph/pm.h"
#endif
#ifdef DEVELHELP
static void print_ipsr(void)
{

View File

@ -0,0 +1,3 @@
MODULE = cortexm_common_periph
include $(RIOTBASE)/Makefile.base

View File

@ -1,5 +1,3 @@
export CPU_ARCH = cortex-m3
USEMODULE += periph_common
include $(RIOTCPU)/Makefile.include.cortexm_common

View File

@ -1,3 +1,5 @@
MODULE = msp430_common
DIRS = periph
include $(RIOTBASE)/Makefile.base

View File

@ -1,7 +1,7 @@
INCLUDES += -I$(RIOTCPU)/msp430_common/include/
export UNDEF += $(BINDIR)/msp430_common/startup.o
export USEMODULE += msp430_common
export USEMODULE += msp430_common msp430_common_periph
DEFAULT_MODULE += oneway_malloc

View File

@ -107,15 +107,3 @@ char *thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
return (char *) stackptr;
}
/******************************************************************************/
/* System reboot */
void pm_reboot(void)
{
/* force an hardware reboot ("Power-Up Clear"), by writing
an illegal value to the watchdog control register */
while (1) {
WDTCTL = 0x0000;
}
}

View File

@ -0,0 +1,3 @@
MODULE = msp430_common_periph
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,30 @@
/*
* Copyright (C) 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
* directory for more details.
*/
/**
* @ingroup cpu_msp430_common
* @{
*
* @file
* @brief MSP430 common periph/pm functions
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include "cpu.h"
void pm_reboot(void)
{
/* force an hardware reboot ("Power-Up Clear"), by writing
an illegal value to the watchdog control register */
while (1) {
WDTCTL = 0x0000;
}
}

View File

@ -12,10 +12,7 @@
* @brief The kernels power management interface
* @{
*
* The following functions *must* be available for every platform:
*
* pm_reboot()
* pm_off()
* This interface *must* be implemented for every platform in RIOT.
*
* @file
* @brief Power management interface

View File

@ -7,7 +7,8 @@
*/
/**
* @ingroup drivers_periph_pm
* @defgroup sys_pm_layered Layered PM Infrastructure
* @ingroup sys
* @{
*
* This module provides a base infrastructure that MCU's may use to implement

View File

@ -7,7 +7,7 @@
*/
/**
* @ingroup drivers_periph_pm
* @ingroup sys_pm_layered
* @{
*
* @file