aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorFabien Poussin <fabien.poussin@gmail.com>2018-09-27 08:28:59 +0200
committerGitHub <noreply@github.com>2018-09-27 08:28:59 +0200
commit38bcaedef46834e8a903c0c4a05884d221d2fc2e (patch)
tree3b42ac586b21ea36c3e5af49edff0d1e357502ea /os
parentfe95e90b80a28dd2f40bfee1ad90822b99519c6a (diff)
parent6f018973caa979897d4c932222b53e705113b612 (diff)
downloadChibiOS-Contrib-38bcaedef46834e8a903c0c4a05884d221d2fc2e.tar.gz
ChibiOS-Contrib-38bcaedef46834e8a903c0c4a05884d221d2fc2e.tar.bz2
ChibiOS-Contrib-38bcaedef46834e8a903c0c4a05884d221d2fc2e.zip
Merge pull request #167 from ObKo/chibios-18.2.x
Diffstat (limited to 'os')
-rw-r--r--os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.mk4
-rw-r--r--os/hal/boards/ST_STM32F0308_DISCOVERY/board.mk4
-rw-r--r--os/hal/hal.mk126
-rw-r--r--os/hal/ports/STM32/LLD/COMPv1/driver.mk9
-rw-r--r--os/hal/ports/STM32/LLD/CRCv1/driver.mk9
-rw-r--r--os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk2
-rw-r--r--os/hal/ports/STM32/LLD/FSMCv1/driver.mk17
-rw-r--r--os/hal/ports/STM32/LLD/LTDCv1/driver.mk2
-rw-r--r--os/hal/ports/STM32/LLD/TIMv1/driver.mk17
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/driver.mk9
-rw-r--r--os/hal/ports/STM32/STM32F0xx/platform.mk23
-rw-r--r--os/hal/ports/STM32/STM32F1xx/platform.mk32
-rw-r--r--os/hal/ports/STM32/STM32F3xx/platform.mk29
-rw-r--r--os/hal/ports/STM32/STM32F4xx/platform.mk39
-rw-r--r--os/hal/ports/STM32/STM32F7xx/platform.mk22
-rw-r--r--os/hal/ports/STM32/STM32L4xx/platform.mk39
-rw-r--r--os/hal/src/hal_ee24xx.c1
-rw-r--r--os/hal/src/hal_ee25xx.c1
-rw-r--r--os/hal/src/usbh/hal_usbh_aoa.c11
-rw-r--r--os/hal/src/usbh/hal_usbh_ftdi.c11
-rw-r--r--os/hal/src/usbh/hal_usbh_msd.c1
-rw-r--r--os/various/fatfs_bindings/fatfs.mk4
-rw-r--r--os/various/fatfs_bindings/fatfs_diskio.c12
-rw-r--r--os/various/ramdisk.c1
24 files changed, 322 insertions, 103 deletions
diff --git a/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.mk b/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.mk
index 8c28257..0303442 100644
--- a/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.mk
+++ b/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.mk
@@ -3,3 +3,7 @@ BOARDSRC = $(CHIBIOS_CONTRIB)/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2/board.
# Required include directories
BOARDINC = $(CHIBIOS_CONTRIB)/os/hal/boards/NONSTANDARD_STM32F4_BARTHESS2
+
+# Shared variables
+ALLCSRC += $(BOARDSRC)
+ALLINC += $(BOARDINC)
diff --git a/os/hal/boards/ST_STM32F0308_DISCOVERY/board.mk b/os/hal/boards/ST_STM32F0308_DISCOVERY/board.mk
index 35b3939..614835d 100644
--- a/os/hal/boards/ST_STM32F0308_DISCOVERY/board.mk
+++ b/os/hal/boards/ST_STM32F0308_DISCOVERY/board.mk
@@ -3,3 +3,7 @@ BOARDSRC = ${CHIBIOS_CONTRIB}/os/hal/boards/ST_STM32F0308_DISCOVERY/board.c
# Required include directories
BOARDINC = ${CHIBIOS_CONTRIB}/os/hal/boards/ST_STM32F0308_DISCOVERY
+
+# Shared variables
+ALLCSRC += $(BOARDSRC)
+ALLINC += $(BOARDINC)
diff --git a/os/hal/hal.mk b/os/hal/hal.mk
index 119db8a..377ffa9 100644
--- a/os/hal/hal.mk
+++ b/os/hal/hal.mk
@@ -1,27 +1,105 @@
include ${CHIBIOS}/os/hal/hal.mk
-HALSRC += ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_nand.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_onewire.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_eicu.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_crc.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_rng.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_debug.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_desciter.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hub.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_ftdi.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_aoa.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hid.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_qei.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_hid.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_msd.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_comp.c
+ifeq ($(USE_SMART_BUILD),yes)
-HALINC += ${CHIBIOS_CONTRIB}/os/hal/include
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+HALSRC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c
+ifneq ($(findstring HAL_USE_NAND TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_nand.c
+endif
+ifneq ($(findstring HAL_USE_ONEWIRE TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_onewire.c
+endif
+ifneq ($(findstring HAL_USE_EICU TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_eicu.c
+endif
+ifneq ($(findstring HAL_USE_CRC TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_crc.c
+endif
+ifneq ($(findstring HAL_USE_RNG TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_rng.c
+endif
+ifneq ($(findstring HAL_USE_USBH TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_debug.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_desciter.c
+endif
+ifneq ($(findstring HAL_USBH_USE_HUB TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hub.c
+endif
+ifneq ($(findstring HAL_USBH_USE_MSD TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c
+endif
+ifneq ($(findstring HAL_USBH_USE_FTDI TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_ftdi.c
+endif
+ifneq ($(findstring HAL_USBH_USE_AOA TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_aoa.c
+endif
+ifneq ($(findstring HAL_USBH_USE_HID TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh_hid.c
+endif
+ifneq ($(findstring HAL_USBH_USE_UVC TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c
+endif
+ifneq ($(findstring HAL_USE_EEPROM TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c
+ifneq ($(findstring EEPROM_USE_EE25XX TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c
+endif
+ifneq ($(findstring EEPROM_USE_EE24XX TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c
+endif
+endif
+ifneq ($(findstring HAL_USE_TIMCAP TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c
+endif
+ifneq ($(findstring HAL_USE_QEI TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_qei.c
+endif
+ifneq ($(findstring HAL_USE_USB_HID TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_hid.c
+endif
+ifneq ($(findstring HAL_USE_USB_MSD TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_msd.c
+endif
+ifneq ($(findstring HAL_USE_COMP TRUE,$(HALCONF)),)
+HALSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/src/hal_comp.c
+endif
+else
+HALSRC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/src/hal_community.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_nand.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_onewire.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_eicu.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_crc.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_rng.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_usbh.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_debug.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_desciter.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hub.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_msd.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_ftdi.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_aoa.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_hid.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/usbh/hal_usbh_uvc.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee24xx.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_ee25xx.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_eeprom.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_timcap.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_qei.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_hid.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_usb_msd.c \
+ ${CHIBIOS_CONTRIB}/os/hal/src/hal_comp.c
+endif
+
+HALINC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/include
+
+# Shared variables
+ALLCSRC += $(HALSRC_CONTRIB)
+ALLINC += $(HALINC_CONTRIB)
diff --git a/os/hal/ports/STM32/LLD/COMPv1/driver.mk b/os/hal/ports/STM32/LLD/COMPv1/driver.mk
new file mode 100644
index 0000000..e819a32
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/COMPv1/driver.mk
@@ -0,0 +1,9 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_COMP TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1
diff --git a/os/hal/ports/STM32/LLD/CRCv1/driver.mk b/os/hal/ports/STM32/LLD/CRCv1/driver.mk
new file mode 100644
index 0000000..b8c16d4
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/CRCv1/driver.mk
@@ -0,0 +1,9 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_CRC TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1
diff --git a/os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk b/os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk
new file mode 100644
index 0000000..22be164
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk
@@ -0,0 +1,2 @@
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1
diff --git a/os/hal/ports/STM32/LLD/FSMCv1/driver.mk b/os/hal/ports/STM32/LLD/FSMCv1/driver.mk
new file mode 100644
index 0000000..d92230d
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/FSMCv1/driver.mk
@@ -0,0 +1,17 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_FSMC TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c
+endif
+ifneq ($(findstring HAL_USE_NAND TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1
diff --git a/os/hal/ports/STM32/LLD/LTDCv1/driver.mk b/os/hal/ports/STM32/LLD/LTDCv1/driver.mk
new file mode 100644
index 0000000..d6cabcd
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/LTDCv1/driver.mk
@@ -0,0 +1,2 @@
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1
diff --git a/os/hal/ports/STM32/LLD/TIMv1/driver.mk b/os/hal/ports/STM32/LLD/TIMv1/driver.mk
new file mode 100644
index 0000000..86eb7c7
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/TIMv1/driver.mk
@@ -0,0 +1,17 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_EICU TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c
+endif
+ifneq ($(findstring HAL_USE_QEI TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c
+endif
+ifneq ($(findstring HAL_USE_TIMCAP TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1
diff --git a/os/hal/ports/STM32/LLD/USBHv1/driver.mk b/os/hal/ports/STM32/LLD/USBHv1/driver.mk
new file mode 100644
index 0000000..b8f8988
--- /dev/null
+++ b/os/hal/ports/STM32/LLD/USBHv1/driver.mk
@@ -0,0 +1,9 @@
+ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_USBH TRUE,$(HALCONF)),)
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+endif
+else
+PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+endif
+
+PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1
diff --git a/os/hal/ports/STM32/STM32F0xx/platform.mk b/os/hal/ports/STM32/STM32F0xx/platform.mk
index 0102162..5bffece 100644
--- a/os/hal/ports/STM32/STM32F0xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F0xx/platform.mk
@@ -1,9 +1,20 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32F0xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c
+ifeq ($(USE_SMART_BUILD),yes)
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/ports/STM32/STM32F1xx/platform.mk b/os/hal/ports/STM32/STM32F1xx/platform.mk
index a8f21bc..9562942 100644
--- a/os/hal/ports/STM32/STM32F1xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F1xx/platform.mk
@@ -1,15 +1,21 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32F1xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c
-
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+ifeq ($(USE_SMART_BUILD),yes)
+
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/ports/STM32/STM32F3xx/platform.mk b/os/hal/ports/STM32/STM32F3xx/platform.mk
index 910fb1f..f41da95 100644
--- a/os/hal/ports/STM32/STM32F3xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F3xx/platform.mk
@@ -1,12 +1,21 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32F3xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c \
-
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+ifeq ($(USE_SMART_BUILD),yes)
+
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/COMPv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/ports/STM32/STM32F4xx/platform.mk b/os/hal/ports/STM32/STM32F4xx/platform.mk
index c312e72..73af8ff 100644
--- a/os/hal/ports/STM32/STM32F4xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F4xx/platform.mk
@@ -1,21 +1,24 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32F4xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c
+ifeq ($(USE_SMART_BUILD),yes)
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/ports/STM32/STM32F7xx/platform.mk b/os/hal/ports/STM32/STM32F7xx/platform.mk
index 2f9392f..1c806a7 100644
--- a/os/hal/ports/STM32/STM32F7xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F7xx/platform.mk
@@ -1,9 +1,19 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32F7xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c
+ifeq ($(USE_SMART_BUILD),yes)
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/ports/STM32/STM32L4xx/platform.mk b/os/hal/ports/STM32/STM32L4xx/platform.mk
index b9bbfea..096fd59 100644
--- a/os/hal/ports/STM32/STM32L4xx/platform.mk
+++ b/os/hal/ports/STM32/STM32L4xx/platform.mk
@@ -1,21 +1,24 @@
include ${CHIBIOS}/os/hal/ports/STM32/STM32L4xx/platform.mk
-PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_eicu_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c
+ifeq ($(USE_SMART_BUILD),yes)
-PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1 \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h $(CONFDIR)/halconf_community.h | egrep -e "\#define"))
+
+else
+endif
+
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/DMA2Dv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/LTDCv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/driver.mk
+include ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/USBHv1/driver.mk
+
+# Shared variables
+ALLCSRC += $(PLATFORMSRC_CONTRIB)
+ALLINC += $(PLATFORMINC_CONTRIB)
diff --git a/os/hal/src/hal_ee24xx.c b/os/hal/src/hal_ee24xx.c
index 725258c..1df1b9f 100644
--- a/os/hal/src/hal_ee24xx.c
+++ b/os/hal/src/hal_ee24xx.c
@@ -334,6 +334,7 @@ static size_t read(void *ip, uint8_t *bp, size_t n) {
}
static const struct EepromFileStreamVMT vmt = {
+ (size_t)0,
write,
read,
eepfs_put,
diff --git a/os/hal/src/hal_ee25xx.c b/os/hal/src/hal_ee25xx.c
index 8c35976..2849e66 100644
--- a/os/hal/src/hal_ee25xx.c
+++ b/os/hal/src/hal_ee25xx.c
@@ -383,6 +383,7 @@ static size_t read(void *ip, uint8_t *bp, size_t n) {
}
static const struct EepromFileStreamVMT vmt = {
+ (size_t)0,
write,
read,
eepfs_put,
diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c
index d565595..1447bdb 100644
--- a/os/hal/src/usbh/hal_usbh_aoa.c
+++ b/os/hal/src/usbh/hal_usbh_aoa.c
@@ -498,7 +498,15 @@ static size_t _read(USBHAOAChannel *aoacp, uint8_t *bp, size_t n) {
return _read_timeout(aoacp, bp, n, TIME_INFINITE);
}
+static msg_t _ctl(USBHAOAChannel *ftdipp, unsigned int operation, void *arg) {
+ (void)ftdipp;
+ (void)operation;
+ (void)arg;
+ return MSG_OK;
+}
+
static const struct AOADriverVMT async_channel_vmt = {
+ (size_t)0,
(size_t (*)(void *, const uint8_t *, size_t))_write,
(size_t (*)(void *, uint8_t *, size_t))_read,
(msg_t (*)(void *, uint8_t))_put,
@@ -506,7 +514,8 @@ static const struct AOADriverVMT async_channel_vmt = {
(msg_t (*)(void *, uint8_t, systime_t))_put_timeout,
(msg_t (*)(void *, systime_t))_get_timeout,
(size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout,
- (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout
+ (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout,
+ (msg_t (*)(void *, unsigned int, void *))_ctl
};
static void _stop_channelS(USBHAOAChannel *aoacp) {
diff --git a/os/hal/src/usbh/hal_usbh_ftdi.c b/os/hal/src/usbh/hal_usbh_ftdi.c
index 6966028..7bd8f2d 100644
--- a/os/hal/src/usbh/hal_usbh_ftdi.c
+++ b/os/hal/src/usbh/hal_usbh_ftdi.c
@@ -600,6 +600,13 @@ static size_t _read(USBHFTDIPortDriver *ftdipp, uint8_t *bp, size_t n) {
return _read_timeout(ftdipp, bp, n, TIME_INFINITE);
}
+static msg_t _ctl(USBHFTDIPortDriver *ftdipp, unsigned int operation, void *arg) {
+ (void)ftdipp;
+ (void)operation;
+ (void)arg;
+ return MSG_OK;
+}
+
static void _vt(void *p) {
USBHFTDIPortDriver *const ftdipp = (USBHFTDIPortDriver *)p;
osalSysLockFromISR();
@@ -615,6 +622,7 @@ static void _vt(void *p) {
}
static const struct FTDIPortDriverVMT async_channel_vmt = {
+ (size_t)0,
(size_t (*)(void *, const uint8_t *, size_t))_write,
(size_t (*)(void *, uint8_t *, size_t))_read,
(msg_t (*)(void *, uint8_t))_put,
@@ -622,7 +630,8 @@ static const struct FTDIPortDriverVMT async_channel_vmt = {
(msg_t (*)(void *, uint8_t, systime_t))_put_timeout,
(msg_t (*)(void *, systime_t))_get_timeout,
(size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout,
- (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout
+ (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout,
+ (msg_t (*)(void *, unsigned int, void *))_ctl
};
diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c
index 7233a0b..fe97ff0 100644
--- a/os/hal/src/usbh/hal_usbh_msd.c
+++ b/os/hal/src/usbh/hal_usbh_msd.c
@@ -683,6 +683,7 @@ static msd_result_t scsi_write10(USBHMassStorageLUNDriver *lunp, uint32_t lba, u
USBHMassStorageLUNDriver MSBLKD[HAL_USBHMSD_MAX_LUNS];
static const struct USBHMassStorageDriverVMT blk_vmt = {
+ (size_t)0,
(bool (*)(void *))usbhmsdLUNIsInserted,
(bool (*)(void *))usbhmsdLUNIsProtected,
(bool (*)(void *))usbhmsdLUNConnect,
diff --git a/os/various/fatfs_bindings/fatfs.mk b/os/various/fatfs_bindings/fatfs.mk
index f2feeb5..2a3b4d6 100644
--- a/os/various/fatfs_bindings/fatfs.mk
+++ b/os/various/fatfs_bindings/fatfs.mk
@@ -5,3 +5,7 @@ FATFSSRC = ${CHIBIOS_CONTRIB}/os/various/fatfs_bindings/fatfs_diskio.c \
$(CHIBIOS)/ext/fatfs/src/ffunicode.c
FATFSINC = ${CHIBIOS}/ext/fatfs/src
+
+# Shared variables
+ALLCSRC += $(FATFSSRC)
+ALLINC += $(FATFSINC)
diff --git a/os/various/fatfs_bindings/fatfs_diskio.c b/os/various/fatfs_bindings/fatfs_diskio.c
index 80d1502..eb732fd 100644
--- a/os/various/fatfs_bindings/fatfs_diskio.c
+++ b/os/various/fatfs_bindings/fatfs_diskio.c
@@ -243,12 +243,12 @@ DRESULT disk_ioctl (
switch (cmd) {
case CTRL_SYNC:
return RES_OK;
-#if _MAX_SS > _MIN_SS
+#if FF_MAX_SS > FF_MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
return RES_OK;
#endif
-#if _USE_TRIM
+#if FF_USE_TRIM
case CTRL_TRIM:
mmcErase(&MMCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
return RES_OK;
@@ -264,7 +264,7 @@ DRESULT disk_ioctl (
case GET_SECTOR_COUNT:
*((DWORD *)buff) = mmcsdGetCardCapacity(&SDCD1);
return RES_OK;
-#if _MAX_SS > _MIN_SS
+#if FF_MAX_SS > FF_MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MMCSD_BLOCK_SIZE;
return RES_OK;
@@ -272,7 +272,7 @@ DRESULT disk_ioctl (
case GET_BLOCK_SIZE:
*((DWORD *)buff) = 256; /* 512b blocks in one erase block */
return RES_OK;
-#if _USE_TRIM
+#if FF_USE_TRIM
case CTRL_TRIM:
sdcErase(&SDCD1, *((DWORD *)buff), *((DWORD *)buff + 1));
return RES_OK;
@@ -289,12 +289,12 @@ DRESULT disk_ioctl (
case GET_SECTOR_COUNT:
*((DWORD *)buff) = MSBLKD[0].info.blk_num;
return RES_OK;
-#if _MAX_SS > _MIN_SS
+#if FF_MAX_SS > FF_MIN_SS
case GET_SECTOR_SIZE:
*((WORD *)buff) = MSBLKD[0].info.blk_size;
return RES_OK;
#endif
-#if _USE_TRIM
+#if FF_USE_TRIM
#error "unimplemented yet!"
// case CTRL_TRIM:
// ....
diff --git a/os/various/ramdisk.c b/os/various/ramdisk.c
index 23bf658..d0d366a 100644
--- a/os/various/ramdisk.c
+++ b/os/various/ramdisk.c
@@ -139,6 +139,7 @@ static bool get_info(void *instance, BlockDeviceInfo *bdip) {
*
*/
static const struct BaseBlockDeviceVMT vmt = {
+ (size_t)0,
is_inserted,
is_protected,
connect,