Browse Source

Merge pull request #6344 from haukepetersen/opt_pm_misc

pm: misc cleanup and fixes
pr/spi.typo
Kaspar Schleiser 6 years ago committed by GitHub
parent
commit
d1db946188
  1. 1
      boards/chronos/Makefile.include
  2. 3
      cpu/arm7_common/Makefile
  3. 2
      cpu/arm7_common/Makefile.include
  4. 7
      cpu/arm7_common/arm_cpu.c
  5. 3
      cpu/arm7_common/periph/Makefile
  6. 29
      cpu/arm7_common/periph/pm.c
  7. 2
      cpu/cc430/Makefile.include
  8. 2
      cpu/cortexm_common/Makefile
  9. 2
      cpu/cortexm_common/Makefile.include
  10. 4
      cpu/cortexm_common/panic.c
  11. 3
      cpu/cortexm_common/periph/Makefile
  12. 0
      cpu/cortexm_common/periph/pm.c
  13. 2
      cpu/lpc1768/Makefile.include
  14. 2
      cpu/msp430_common/Makefile
  15. 2
      cpu/msp430_common/Makefile.include
  16. 12
      cpu/msp430_common/cpu.c
  17. 3
      cpu/msp430_common/periph/Makefile
  18. 30
      cpu/msp430_common/periph/pm.c
  19. 5
      drivers/include/periph/pm.h
  20. 3
      sys/include/pm_layered.h
  21. 2
      sys/pm_layered/pm.c

1
boards/chronos/Makefile.include

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

3
cpu/arm7_common/Makefile

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

2
cpu/arm7_common/Makefile.include

@ -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/

7
cpu/arm7_common/arm_cpu.c

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

3
cpu/arm7_common/periph/Makefile

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

29
cpu/arm7_common/periph/pm.c

@ -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();
}
}

2
cpu/cc430/Makefile.include

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

2
cpu/cortexm_common/Makefile

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

2
cpu/cortexm_common/Makefile.include

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

4
cpu/cortexm_common/panic.c

@ -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)
{

3
cpu/cortexm_common/periph/Makefile

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

0
cpu/cortexm_common/pm.c → cpu/cortexm_common/periph/pm.c

2
cpu/lpc1768/Makefile.include

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

2
cpu/msp430_common/Makefile

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

2
cpu/msp430_common/Makefile.include

@ -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

12
cpu/msp430_common/cpu.c

@ -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;
}
}

3
cpu/msp430_common/periph/Makefile

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

30
cpu/msp430_common/periph/pm.c

@ -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;
}
}

5
drivers/include/periph/pm.h

@ -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

3
sys/include/pm_layered.h

@ -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

2
sys/pm_layered/pm.c

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

Loading…
Cancel
Save