diff --git a/firmware/Makefile b/firmware/Makefile index d4b4afdcba..9342d8f8dd 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -37,21 +37,19 @@ endif # Compiler options here. ifeq ($(USE_OPT),) - USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes + USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -fomit-frame-pointer -falign-functions=16 endif - USE_OPT += $(RUSEFI_OPT) # C specific options here (added to USE_OPT). ifeq ($(USE_COPT),) - USE_COPT = -fgnu89-inline -std=gnu99 -Werror-implicit-function-declaration + USE_COPT = -fgnu89-inline -std=gnu99 -Wno-error=implicit-fallthrough endif # C++ specific options here (added to USE_OPT). ifeq ($(USE_CPPOPT),) - # constexpr float expf_taylor_impl probably needs just c++14 but why not go with 17? - USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-threadsafe-statics -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits + USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-threadsafe-statics -fno-exceptions -fno-use-cxa-atexit endif # Enable this if you want the linker to remove unused code and data diff --git a/firmware/bootloader/!compile_bootloader_405.bat b/firmware/bootloader/!compile_bootloader_405.bat index 22ce79292f..677b81af1e 100644 --- a/firmware/bootloader/!compile_bootloader_405.bat +++ b/firmware/bootloader/!compile_bootloader_405.bat @@ -2,7 +2,7 @@ echo Starting compilation for Prometheus-405 -set PROJECT_BOARD=Prometheus +set PROJECT_BOARD=prometheus/f405 set PROMETHEUS_BOARD=405 set EXTRA_PARAMS=-DDUMMY -DEFI_BOOTLOADER -DSTM32F405xx -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE ^ -DBOARD_TLE8888_COUNT=0 ^ diff --git a/firmware/bootloader/!compile_bootloader_469.bat b/firmware/bootloader/!compile_bootloader_469.bat index c4c08cb06e..8ce14aa36a 100644 --- a/firmware/bootloader/!compile_bootloader_469.bat +++ b/firmware/bootloader/!compile_bootloader_469.bat @@ -2,7 +2,7 @@ echo Starting compilation for Prometheus-469 -set PROJECT_BOARD=Prometheus +set PROJECT_BOARD=prometheus/f469 set PROMETHEUS_BOARD=469 set EXTRA_PARAMS=-DDUMMY -DEFI_BOOTLOADER -DSTM32F469xx -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE ^ -DBOARD_TLE8888_COUNT=0 ^ diff --git a/firmware/bootloader/init.h b/firmware/bootloader/init.h deleted file mode 100644 index bf59efc978..0000000000 --- a/firmware/bootloader/init.h +++ /dev/null @@ -1,2 +0,0 @@ - -void reconfigureSensors(); diff --git a/firmware/bootloader/src/Makefile b/firmware/bootloader/src/Makefile index 3d26e4a3ca..297a2ce4f1 100644 --- a/firmware/bootloader/src/Makefile +++ b/firmware/bootloader/src/Makefile @@ -133,6 +133,7 @@ include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CONFIG)/boards/$(PROJECT_BOARD)/board.mk +include $(PROJECT_DIR)/init/init.mk include $(PROJECT_DIR)/util/util.mk include $(PROJECT_DIR)/controllers/controllers.mk @@ -250,6 +251,7 @@ INCDIR = .. $(CHIBIOS)/os/license \ $(PROJECT_DIR)/development/test \ $(CONTROLLERS_INC) \ $(PROJECT_DIR)/controllers/sensors \ + $(PROJECT_DIR)/init \ config BUILDDIR=blbuild diff --git a/firmware/config/boards/prometheus/board_configuration.cpp b/firmware/config/boards/prometheus/board_configuration.cpp index ebd518aa08..97d8fdb404 100644 --- a/firmware/config/boards/prometheus/board_configuration.cpp +++ b/firmware/config/boards/prometheus/board_configuration.cpp @@ -89,22 +89,22 @@ void setPinConfigurationOverrides(void) { } #else palSetPadMode(GPIOA, 10, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOA, 10, true); + palWritePad(GPIOA, 10, 1); palSetPadMode(GPIOA, 9, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOA, 9, true); + palWritePad(GPIOA, 9, 1); palSetPadMode(GPIOA, 8, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOA, 8, true); + palWritePad(GPIOA, 8, 1); palSetPadMode(GPIOA, 11, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOA, 11, true); + palWritePad(GPIOA, 11, 1); palSetPadMode(GPIOD, 9, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOD, 9, false); + palWritePad(GPIOD, 9, 0); palSetPadMode(GPIOD, 15, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOD, 15, false); + palWritePad(GPIOD, 15, 0); palSetPadMode(GPIOD, 10, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOD, 10, false); + palWritePad(GPIOD, 10, 0); palSetPadMode(GPIOD, 14, PAL_MODE_OUTPUT_PUSHPULL); - palWritePad(GPIOD, 14, false); + palWritePad(GPIOD, 14, 0); #endif } diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 057aa2f72c..67ce64b99c 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -106,11 +106,9 @@ void initDataStructures(DECLARE_ENGINE_PARAMETER_SIGNATURE) { initSpeedDensity(PASS_ENGINE_PARAMETER_SIGNATURE); } -void initSensors0(); - static void mostCommonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { #if !EFI_UNIT_TEST - initSensors0(); + initSensors(); #endif /* EFI_UNIT_TEST */ initSensors(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/firmware/init/init.h b/firmware/init/init.h index b623030c44..ec8ae1bdfd 100644 --- a/firmware/init/init.h +++ b/firmware/init/init.h @@ -5,7 +5,7 @@ #pragma once // Call this once at startup to initialize, configure, and subscribe sensors -void initSensors0(); +void initSensors(); // Call this whenever the configuration may have changed, so any sensors // can be reconfigured with the new settings. diff --git a/firmware/init/sensor/init_sensors.cpp b/firmware/init/sensor/init_sensors.cpp index e7985bab85..10c4e15d89 100644 --- a/firmware/init/sensor/init_sensors.cpp +++ b/firmware/init/sensor/init_sensors.cpp @@ -12,7 +12,7 @@ static void initSensorCli(); void initTps(); void initOilPressure(); -void initSensors0() { +void initSensors() { initTps(); initOilPressure(); diff --git a/firmware/rusefi_rules.mk b/firmware/rusefi_rules.mk index 4232098583..e23f9fb865 100644 --- a/firmware/rusefi_rules.mk +++ b/firmware/rusefi_rules.mk @@ -1,5 +1,5 @@ -RUSEFI_OPT=-Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers +# Warnings-as-errors... +RUSEFI_OPT = -Werror -RUSEFI_OPT+=-Wno-error=missing-prototypes - -RUSEFI_OPT+=-Werror=switch \ No newline at end of file +# ...except these few +RUSEFI_OPT += -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter