diff --git a/firmware/Makefile b/firmware/Makefile index dfc82bc876..582018e448 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -7,13 +7,7 @@ CHIBIOS = ChibiOS4 RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC RULESFILE = $(RULESPATH)/rules.mk -ifeq ("$(wildcard $(RULESFILE))","") -# -# todo: someone please figure out the syntax to invoke 'git submodule update --init' from here -# -$(error Modules are missing? Did you execute 'git submodule update --init'?) -endif - +include rusefi.mk # by default EXTRA_PARAMS is empty and we create 'debug' version of the firmware with additional assertions and statistics # for 'release' options see 'clean_compile_two_versions.bat' file @@ -114,27 +108,6 @@ PROJECT_DIR = . # Imported source files and paths CHIBIOS_CONTRIB = ChibiOS-Contrib -ifeq ($(PROJECT_BOARD),) - PROJECT_BOARD = ST_STM32F4 -endif -DDEFS += -D$(PROJECT_BOARD) - -ifeq ($(PROJECT_CPU),) - PROJECT_CPU = ST_STM32F4 -endif -DDEFS += -D$(PROJECT_CPU) - -# CPU-dependent defs -ifeq ($(PROJECT_CPU),ST_STM32F7) -CPU_STARTUP = startup_stm32f7xx.mk -CPU_PLATFORM = STM32F7xx/platform.mk -CPU_HWLAYER = stm32f7 -else # ST_STM32F4 -CPU_STARTUP = startup_stm32f4xx.mk -CPU_PLATFORM = STM32F4xx/platform.mk -CPU_HWLAYER = stm32f4 -endif - # Startup files. include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/$(CPU_STARTUP) # HAL-OSAL files (optional). diff --git a/firmware/rusefi.mk b/firmware/rusefi.mk new file mode 100644 index 0000000000..258d41cc91 --- /dev/null +++ b/firmware/rusefi.mk @@ -0,0 +1,28 @@ + +ifeq ("$(wildcard $(RULESFILE))","") +# +# todo: someone please figure out the syntax to invoke 'git submodule update --init' from here +# +$(error Modules are missing? Did you execute 'git submodule update --init'?) +endif + +ifeq ($(PROJECT_BOARD),) + PROJECT_BOARD = ST_STM32F4 +endif +DDEFS += -D$(PROJECT_BOARD) + +ifeq ($(PROJECT_CPU),) + PROJECT_CPU = ST_STM32F4 +endif +DDEFS += -D$(PROJECT_CPU) + +# CPU-dependent defs +ifeq ($(PROJECT_CPU),ST_STM32F7) +CPU_STARTUP = startup_stm32f7xx.mk +CPU_PLATFORM = STM32F7xx/platform.mk +CPU_HWLAYER = stm32f7 +else # ST_STM32F4 +CPU_STARTUP = startup_stm32f4xx.mk +CPU_PLATFORM = STM32F4xx/platform.mk +CPU_HWLAYER = stm32f4 +endif diff --git a/work_in_progress.md b/work_in_progress.md index fe70802b0e..4dda320573 100644 --- a/work_in_progress.md +++ b/work_in_progress.md @@ -1,2 +1,3 @@ Dec 2018 status: -Electronic throttle body https://rusefi.com/forum/viewtopic.php?f=5&t=592 \ No newline at end of file +* Electronic throttle body https://rusefi.com/forum/viewtopic.php?f=5&t=592 +* Ion Sense https://rusefi.com/forum/viewtopic.php?f=4&t=963 \ No newline at end of file