[stm32] share power.c across stm32 platforms.

Previously power.c was only implemented for f7, but the
same functionality exists in other stm32 devices, thanks
to CMSIS defines.

This refactors out f7's power.c to platform/stm32/ and adds
deps from f7 and f4.
This commit is contained in:
Girts Folkmanis
2016-09-15 13:33:58 -07:00
parent 0c782aa381
commit 58ee575dcb
4 changed files with 12 additions and 1 deletions

10
platform/stm32/rules.mk Normal file
View File

@@ -0,0 +1,10 @@
# Code shared across different stm32 platforms.
LOCAL_DIR := $(GET_LOCAL_DIR)
MODULE := $(LOCAL_DIR)
MODULE_SRCS += \
$(LOCAL_DIR)/power.c
include make/module.mk

View File

@@ -47,6 +47,7 @@ LINKER_SCRIPT += \
$(BUILDDIR)/system-twosegment.ld
MODULE_DEPS += \
platform/stm32 \
platform/stm32f4xx/STM32F4xx_StdPeriph_Driver \
arch/arm/arm-m/systick \
lib/cbuf \

View File

@@ -43,7 +43,6 @@ MODULE_SRCS += \
$(LOCAL_DIR)/flash.c \
$(LOCAL_DIR)/gpio.c \
$(LOCAL_DIR)/init.c \
$(LOCAL_DIR)/power.c \
$(LOCAL_DIR)/timer.c \
$(LOCAL_DIR)/uart.c \
$(LOCAL_DIR)/usbc.c \
@@ -60,6 +59,7 @@ LINKER_SCRIPT += \
$(BUILDDIR)/system-twosegment.ld
MODULE_DEPS += \
platform/stm32 \
platform/stm32f7xx/STM32F7xx_HAL_Driver \
arch/arm/arm-m/systick \
dev/gpio \