From e558e86d7401239a9ba369bfac298bdead236ecc Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 3 Apr 2016 10:58:22 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9233 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/hal.mk | 2 +- os/hal/ports/STM32/STM32F0xx/platform.mk | 2 +- os/hal/ports/STM32/STM32F1xx/platform.mk | 2 +- os/hal/ports/STM32/STM32F1xx/platform_f105_f107.mk | 2 +- os/hal/ports/STM32/STM32F37x/platform.mk | 2 +- os/hal/ports/STM32/STM32F3xx/platform.mk | 2 +- os/hal/ports/STM32/STM32F4xx/platform.mk | 2 +- os/hal/ports/STM32/STM32F7xx/platform.mk | 2 +- os/hal/ports/STM32/STM32L0xx/platform.mk | 2 +- os/hal/ports/STM32/STM32L1xx/platform.mk | 2 +- os/hal/ports/STM32/STM32L4xx/platform.mk | 2 +- os/hal/ports/common/platform.mk | 24 +++++++++++++ os/hal/templates/board/board.c | 24 +++++++++++++ os/hal/templates/board/board.h | 40 ++++++++++++++++++++++ os/hal/templates/board/board.mk | 5 +++ os/hal/templates/hal_i2s_lld.c | 1 + os/hal/templates/hal_wdg_lld.c | 5 ++- os/hal/templates/platform.mk | 20 ----------- os/nil/nil.mk | 2 +- os/rt/rt.mk | 2 +- 20 files changed, 111 insertions(+), 34 deletions(-) create mode 100644 os/hal/ports/common/platform.mk create mode 100644 os/hal/templates/board/board.c create mode 100644 os/hal/templates/board/board.h create mode 100644 os/hal/templates/board/board.mk delete mode 100644 os/hal/templates/platform.mk (limited to 'os') diff --git a/os/hal/hal.mk b/os/hal/hal.mk index 4d5f95f20..01e21c97e 100644 --- a/os/hal/hal.mk +++ b/os/hal/hal.mk @@ -1,7 +1,7 @@ # List of all the ChibiOS/HAL files, there is no need to remove the files # from this list, you can disable parts of the HAL by editing halconf.h. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) HALSRC := $(CHIBIOS)/os/hal/src/hal.c \ $(CHIBIOS)/os/hal/src/hal_st.c \ diff --git a/os/hal/ports/STM32/STM32F0xx/platform.mk b/os/hal/ports/STM32/STM32F0xx/platform.mk index c773c5f87..4a33ceec5 100644 --- a/os/hal/ports/STM32/STM32F0xx/platform.mk +++ b/os/hal/ports/STM32/STM32F0xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F0xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F1xx/platform.mk b/os/hal/ports/STM32/STM32F1xx/platform.mk index ea64e57d5..5721df850 100644 --- a/os/hal/ports/STM32/STM32F1xx/platform.mk +++ b/os/hal/ports/STM32/STM32F1xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F1xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F1xx/platform_f105_f107.mk b/os/hal/ports/STM32/STM32F1xx/platform_f105_f107.mk index 7f26f33c3..c2c023e24 100644 --- a/os/hal/ports/STM32/STM32F1xx/platform_f105_f107.mk +++ b/os/hal/ports/STM32/STM32F1xx/platform_f105_f107.mk @@ -1,6 +1,6 @@ # List of all the STM32F1xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F37x/platform.mk b/os/hal/ports/STM32/STM32F37x/platform.mk index 507295b71..932c90b60 100644 --- a/os/hal/ports/STM32/STM32F37x/platform.mk +++ b/os/hal/ports/STM32/STM32F37x/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F37x platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F37x/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F3xx/platform.mk b/os/hal/ports/STM32/STM32F3xx/platform.mk index 741a9549e..028a707cc 100644 --- a/os/hal/ports/STM32/STM32F3xx/platform.mk +++ b/os/hal/ports/STM32/STM32F3xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F3xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F4xx/platform.mk b/os/hal/ports/STM32/STM32F4xx/platform.mk index 77008189c..055657d8d 100644 --- a/os/hal/ports/STM32/STM32F4xx/platform.mk +++ b/os/hal/ports/STM32/STM32F4xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F2xx/STM32F4xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32F7xx/platform.mk b/os/hal/ports/STM32/STM32F7xx/platform.mk index 4d2384d28..67200e45c 100644 --- a/os/hal/ports/STM32/STM32F7xx/platform.mk +++ b/os/hal/ports/STM32/STM32F7xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32F7xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32F7xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32L0xx/platform.mk b/os/hal/ports/STM32/STM32L0xx/platform.mk index 402a3e4d7..2de29678e 100644 --- a/os/hal/ports/STM32/STM32L0xx/platform.mk +++ b/os/hal/ports/STM32/STM32L0xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32L0xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c \ diff --git a/os/hal/ports/STM32/STM32L1xx/platform.mk b/os/hal/ports/STM32/STM32L1xx/platform.mk index e4486c731..9bc3bf2c0 100644 --- a/os/hal/ports/STM32/STM32L1xx/platform.mk +++ b/os/hal/ports/STM32/STM32L1xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32L1xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_lld.c \ diff --git a/os/hal/ports/STM32/STM32L4xx/platform.mk b/os/hal/ports/STM32/STM32L4xx/platform.mk index e6ea2706b..ee8210600 100644 --- a/os/hal/ports/STM32/STM32L4xx/platform.mk +++ b/os/hal/ports/STM32/STM32L4xx/platform.mk @@ -1,6 +1,6 @@ # List of all the STM32L4xx platform files. ifeq ($(USE_SMART_BUILD),yes) -HALCONF := $(strip $(shell cat halconf.h | egrep -e "define")) +HALCONF := $(strip $(shell cat halconf.h | egrep -e "\#define")) PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ $(CHIBIOS)/os/hal/ports/STM32/STM32L4xx/hal_lld.c \ diff --git a/os/hal/ports/common/platform.mk b/os/hal/ports/common/platform.mk new file mode 100644 index 000000000..d123a5d0f --- /dev/null +++ b/os/hal/ports/common/platform.mk @@ -0,0 +1,24 @@ +# List of all the template platform files. +PLATFORMSRC = ${CHIBIOS}/os/hal/templates/hal_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_adc_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_can_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_dac_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_ext_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_i2s_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_icu_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_mac_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_pal_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_rtc_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_serial_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_spi_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_st_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_uart_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_usb_lld.c \ + ${CHIBIOS}/os/hal/templates/hal_wdg_lld.c + +# Required include directories +PLATFORMINC = ${CHIBIOS}/os/hal/templates diff --git a/os/hal/templates/board/board.c b/os/hal/templates/board/board.c new file mode 100644 index 000000000..967202992 --- /dev/null +++ b/os/hal/templates/board/board.c @@ -0,0 +1,24 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/os/hal/templates/board/board.h b/os/hal/templates/board/board.h new file mode 100644 index 000000000..408cbb918 --- /dev/null +++ b/os/hal/templates/board/board.h @@ -0,0 +1,40 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for a generic board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC +#define BOARD_NAME "Generic Board" + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/os/hal/templates/board/board.mk b/os/hal/templates/board/board.mk new file mode 100644 index 000000000..a8506ee07 --- /dev/null +++ b/os/hal/templates/board/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(CHIBIOS)/os/hal/templates/board/board.c + +# Required include directories +BOARDINC = $(CHIBIOS)/os/hal/templates/board diff --git a/os/hal/templates/hal_i2s_lld.c b/os/hal/templates/hal_i2s_lld.c index 3a77b2636..7424a663a 100644 --- a/os/hal/templates/hal_i2s_lld.c +++ b/os/hal/templates/hal_i2s_lld.c @@ -84,6 +84,7 @@ void i2s_lld_start(I2SDriver *i2sp) { } #endif + } } /** diff --git a/os/hal/templates/hal_wdg_lld.c b/os/hal/templates/hal_wdg_lld.c index 603379684..b446a30d5 100644 --- a/os/hal/templates/hal_wdg_lld.c +++ b/os/hal/templates/hal_wdg_lld.c @@ -34,7 +34,7 @@ /* Driver exported variables. */ /*===========================================================================*/ -#if STM32_WDG_USE_WDG1 || defined(__DOXYGEN__) +#if PLATFORM_WDG_USE_WDG1 || defined(__DOXYGEN__) WDGDriver WDGD1; #endif @@ -72,6 +72,7 @@ void wdg_lld_init(void) { */ void wdg_lld_start(WDGDriver *wdgp) { + (void)wdgp; } /** @@ -83,6 +84,7 @@ void wdg_lld_start(WDGDriver *wdgp) { */ void wdg_lld_stop(WDGDriver *wdgp) { + (void)wdgp; } /** @@ -94,6 +96,7 @@ void wdg_lld_stop(WDGDriver *wdgp) { */ void wdg_lld_reset(WDGDriver * wdgp) { + (void)wdgp; } #endif /* HAL_USE_WDG */ diff --git a/os/hal/templates/platform.mk b/os/hal/templates/platform.mk deleted file mode 100644 index a5fbb1065..000000000 --- a/os/hal/templates/platform.mk +++ /dev/null @@ -1,20 +0,0 @@ -# List of all the template platform files. -PLATFORMSRC = ${CHIBIOS}/os/hal/templates/hal_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_adc_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_can_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_dac_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_ext_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_gpt_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_i2c_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_icu_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_mac_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_pal_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_pwm_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_sdc_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_serial_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_spi_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_uart_lld.c \ - ${CHIBIOS}/os/hal/templates/hal_usb_lld.c - -# Required include directories -PLATFORMINC = ${CHIBIOS}/os/hal/templates diff --git a/os/nil/nil.mk b/os/nil/nil.mk index 496100648..f0717ba68 100644 --- a/os/nil/nil.mk +++ b/os/nil/nil.mk @@ -1,7 +1,7 @@ # List of all the ChibiOS/NIL kernel files, there is no need to remove the files # from this list, you can disable parts of the kernel by editing chconf.h. ifeq ($(USE_SMART_BUILD),yes) -CHCONF := $(strip $(shell cat chconf.h | egrep -e "define")) +CHCONF := $(strip $(shell cat chconf.h | egrep -e "\#define")) KERNSRC := ${CHIBIOS}/os/nil/src/ch.c ifneq ($(findstring CH_CFG_USE_MAILBOXES TRUE,$(CHCONF)),) KERNSRC += $(CHIBIOS)/os/common/oslib/src/chmboxes.c diff --git a/os/rt/rt.mk b/os/rt/rt.mk index c445d305f..5d01736c2 100644 --- a/os/rt/rt.mk +++ b/os/rt/rt.mk @@ -1,7 +1,7 @@ # List of all the ChibiOS/RT kernel files, there is no need to remove the files # from this list, you can disable parts of the kernel by editing chconf.h. ifeq ($(USE_SMART_BUILD),yes) -CHCONF := $(strip $(shell cat chconf.h | egrep -e "define")) +CHCONF := $(strip $(shell cat chconf.h | egrep -e "\#define")) KERNSRC := $(CHIBIOS)/os/rt/src/chsys.c \ $(CHIBIOS)/os/rt/src/chdebug.c \ -- cgit v1.2.3