Skip to content

Commit

Permalink
move SHORT_BOARD_NAME in to a makefile variable #300
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 7, 2023
1 parent 3402870 commit bb1b4bf
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 27 deletions.
5 changes: 5 additions & 0 deletions firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ MAKEFLAGS += ${NUMJOBS}

BOARDINC = $(BOARD_DIR)
include $(BOARD_DIR)/board.mk
ifeq ($(SHORT_BOARD_NAME),)
$(error SHORT_BOARD_NAME not set, something wrong with your board.mk file)
endif
DDEFS += -DSHORT_BOARD_NAME=$(SHORT_BOARD_NAME)

# Include various ChibiOS mk files
# Licensing files.
Expand Down Expand Up @@ -201,6 +205,7 @@ endif
$(info PROJECT_BOARD: $(PROJECT_BOARD))
$(info BOARD_DIR: $(BOARD_DIR))
$(info PROJECT_CPU: $(PROJECT_CPU))
$(info SHORT_BOARD_NAME: $(SHORT_BOARD_NAME))
$(info CPU_HWLAYER: $(CPU_HWLAYER))
$(info CONFDIR: $(CONFDIR))
$(info LDSCRIPT: $(LDSCRIPT))
Expand Down
2 changes: 1 addition & 1 deletion firmware/config/boards/atlas/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ DDEFS += -DHW_ATLAS=1
LWIP = yes
DDEFS += -DEFI_ETHERNET=TRUE

DDEFS += -DSHORT_BOARD_NAME=atlas
SHORT_BOARD_NAME = atlas
2 changes: 1 addition & 1 deletion firmware/config/boards/core48/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp

# Override DEFAULT_ENGINE_TYPE
DDEFS += -DSHORT_BOARD_NAME=core48
SHORT_BOARD_NAME = core48
DDEFS += -DFIRMWARE_ID=\"core48\"
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
2 changes: 1 addition & 1 deletion firmware/config/boards/core8/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp

# Override DEFAULT_ENGINE_TYPE
DDEFS += -DSHORT_BOARD_NAME=core8
SHORT_BOARD_NAME = core8
DDEFS += -DFIRMWARE_ID=\"core8\"
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
2 changes: 2 additions & 0 deletions firmware/config/boards/f407-discovery/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ BOARDCPPSRC = $(BOARD_DIR)/board_extra.cpp
# MCU defines
DDEFS += -DSTM32F407xx

SHORT_BOARD_NAME = f407-discovery

ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=DEFAULT_FRANKENSO
endif
Expand Down
2 changes: 1 addition & 1 deletion firmware/config/boards/f429-discovery/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DDEFS += -DSTM32_USB_USE_OTG2=TRUE
DDEFS += -DHAL_USE_SDRAM=TRUE
DDEFS += -DHAL_USE_FSMC=TRUE

DDEFS += -DSHORT_BOARD_NAME=f429-discovery
SHORT_BOARD_NAME = f429-discovery

# Shared variables
ALLINC += $(BOARDINC)
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/alphax-2chan/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ include $(BOARDS_DIR)/hellen/hellen-common144.mk

DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

DDEFS += -DSHORT_BOARD_NAME=alphax-2chan
SHORT_BOARD_NAME = alphax-2chan

2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/alphax-4chan/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ include $(BOARDS_DIR)/hellen/hellen-common144.mk

DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

DDEFS += -DSHORT_BOARD_NAME=alphax-4chan
SHORT_BOARD_NAME = alphax-4chan
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/alphax-8chan/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ include $(BOARDS_DIR)/hellen/hellen-common144.mk

DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

DDEFS += -DSHORT_BOARD_NAME=alphax-8chan
SHORT_BOARD_NAME = alphax-8chan
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/harley81/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ include $(BOARDS_DIR)/hellen/hellen-common144.mk
# Enable serial pins on expansion header
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

DDEFS += -DSHORT_BOARD_NAME=harley81
SHORT_BOARD_NAME = harley81

2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen-gm-e67/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
include $(BOARDS_DIR)/hellen/hellen-common144.mk


DDEFS += -DSHORT_BOARD_NAME=hellen-gm-e67
SHORT_BOARD_NAME = hellen-gm-e67
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen-honda-k/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ DDEFS += -DADC_MUX_PIN=Gpio::F2
DDEFS += -DFIRMWARE_ID=\"hellen-honda-k\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellen-honda-k
SHORT_BOARD_NAME = hellen-honda-k

include $(BOARDS_DIR)/hellen/hellen-common144.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen-nb1/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ include $(BOARDS_DIR)/hellen/hellen-common144.mk
# Enable serial pins on expansion header
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)

DDEFS += -DSHORT_BOARD_NAME=hellen-nb1
SHORT_BOARD_NAME = hellen-nb1
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen121nissan/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
# bad temporary solution of hardware issue https://github.com/rusefi/rusefi/issues/4821
DDEFS += -DMAX_TPS_PPS_DISCREPANCY=10.0f

DDEFS += -DSHORT_BOARD_NAME=hellen121nissan
SHORT_BOARD_NAME = hellen121nissan

include $(BOARDS_DIR)/hellen/hellen-common144.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen121vag/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
DDEFS += -DFIRMWARE_ID=\"hellen121vag\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellen121vag
SHORT_BOARD_NAME = hellen121vag

include $(BOARDS_DIR)/hellen/hellen-common176.mk

2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen128/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
DDEFS += -DFIRMWARE_ID=\"hellen128\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellen128
SHORT_BOARD_NAME = hellen128

include $(BOARDS_DIR)/hellen/hellen-common176.mk

2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen154hyundai/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
DDEFS += -DFIRMWARE_ID=\"hellen154hyundai\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellen154hyundai
SHORT_BOARD_NAME = hellen154hyundai

include $(BOARDS_DIR)/hellen/hellen-common144.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
# https://github.com/rusefi/hellenNA6_issues/issues/35 hack :(
DDEFS += -DDISABLE_PIN_STATE_VALIDATION=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellenNA6
SHORT_BOARD_NAME = hellenNA6

include $(BOARDS_DIR)/hellen/hellen-common176.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen72/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
DDEFS += -DFIRMWARE_ID=\"hellen72\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE

DDEFS += -DSHORT_BOARD_NAME=hellen72
SHORT_BOARD_NAME = hellen72

include $(BOARDS_DIR)/hellen/hellen-common176.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen81/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ DDEFS += -DHAL_TRIGGER_USE_ADC=TRUE
# DDEFS += -DADC_BUF_NUM_AVG=1


DDEFS += -DSHORT_BOARD_NAME=hellen81
SHORT_BOARD_NAME = hellen81

include $(BOARDS_DIR)/hellen/hellen-common176.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellen88bmw/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
# Add them all together
DDEFS += -DFIRMWARE_ID=\"hellen88bmw\" $(VAR_DEF_ENGINE_TYPE)

DDEFS += -DSHORT_BOARD_NAME=hellen88bmw
SHORT_BOARD_NAME = hellen88bmw

include $(BOARDS_DIR)/hellen/hellen-common144.mk
2 changes: 1 addition & 1 deletion firmware/config/boards/hellen/hellenNA8_96/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DDEFS += -DFIRMWARE_ID=\"hellenNB1\" $(VAR_DEF_ENGINE_TYPE)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
include $(BOARDS_DIR)/hellen/hellen-common144.mk

DDEFS += -DSHORT_BOARD_NAME=hellenNA8_96
SHORT_BOARD_NAME = hellenNA8_96

# Enable serial pins on expansion header
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)
Expand Down
3 changes: 2 additions & 1 deletion firmware/config/boards/hellen/small-can-board/board.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp

DDEFS += -DFIRMWARE_ID=\"small-can-board\"
DDEFS += -DSHORT_BOARD_NAME=small-can-board -DSTATIC_BOARD_ID=STATIC_BOARD_ID_SMALL_CAN_BOARD
SHORT_BOARD_NAME = small-can-board
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_SMALL_CAN_BOARD

#DDEFS += -DEFI_SENT_SUPPORT=TRUE

Expand Down
4 changes: 2 additions & 2 deletions firmware/config/boards/microrusefi/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ DDEFS += -DEFI_SENT_SUPPORT=TRUE
DDEFS += -DHW_MICRO_RUSEFI=1

ifeq ($(PROJECT_CPU),ARCH_STM32F7)
DDEFS += -DSHORT_BOARD_NAME=mre_f7
SHORT_BOARD_NAME = mre_f7
else ifeq ($(PROJECT_CPU),ARCH_STM32F4)
DDEFS += -DSHORT_BOARD_NAME=mre_f4
SHORT_BOARD_NAME = mre_f4
else
$(error Unsupported PROJECT_CPU for microRusEFI: [$(PROJECT_CPU)])
endif
6 changes: 3 additions & 3 deletions firmware/config/boards/proteus/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ include $(BOARDS_DIR)/proteus/proteus-base.mk
DDEFS += -DFIRMWARE_ID=\"proteus\"

ifeq ($(PROJECT_CPU),ARCH_STM32F7)
DDEFS += -DSHORT_BOARD_NAME=proteus_f7
SHORT_BOARD_NAME = proteus_f7
else ifeq ($(PROJECT_CPU),ARCH_STM32F4)
DDEFS += -DSHORT_BOARD_NAME=proteus_f4
SHORT_BOARD_NAME = proteus_f4
else ifeq ($(PROJECT_CPU),ARCH_STM32H7)
DDEFS += -DSHORT_BOARD_NAME=proteus_h7
SHORT_BOARD_NAME = proteus_h7
else
$(error Unsupported PROJECT_CPU for Proteus: [$(PROJECT_CPU)])
endif
2 changes: 1 addition & 1 deletion firmware/config/boards/subaru_eg33/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::G7
DDEFS += -DHW_SUBARU_EG33=1
DDEFS += -DFIRMWARE_ID=\"EG33\"

DDEFS += -DSHORT_BOARD_NAME=subaru_eg33_f7
SHORT_BOARD_NAME = subaru_eg33_f7

# Override DEFAULT_ENGINE_TYPE
DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS
Expand Down

0 comments on commit bb1b4bf

Please sign in to comment.