diff --git a/firmware/Makefile b/firmware/Makefile index fc6ee6eeb2..d44b49113d 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -27,7 +27,7 @@ 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-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes + USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror-implicit-function-declaration -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 -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes endif # C specific options here (added to USE_OPT). diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 5ac6622526..a13927eb8b 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -135,6 +135,9 @@ ADC_TwoSamplingDelay_20Cycles, // cr1 , // In this field must be specified the sample times for channels 0...9 + 0, + 0, + 0, // Conversion group sequence 13...16 + sequence length 0, // Conversion group sequence 7...12 0 // Conversion group sequence 1...6 @@ -170,6 +173,9 @@ ADC_TwoSamplingDelay_5Cycles, // cr1 ADC_SMPR2_SMP_AN8(ADC_SAMPLING_FAST) | ADC_SMPR2_SMP_AN9(ADC_SAMPLING_FAST), // In this field must be specified the sample times for channels 0...9 + 0, + 0, + 0, // Conversion group sequence 13...16 + sequence length 0, // Conversion group sequence 7...12 diff --git a/firmware/hw_layer/hip9011.cpp b/firmware/hw_layer/hip9011.cpp index c1ca632e64..e8412ad511 100644 --- a/firmware/hw_layer/hip9011.cpp +++ b/firmware/hw_layer/hip9011.cpp @@ -84,12 +84,14 @@ static Logging *logger; // todo: nicer method which would mention SPI speed explicitly? #if EFI_PROD_CODE -static SPIConfig hipSpiCfg = { /* end_cb */ NULL, -/* HW dependent part.*/ - /* ssport */ NULL, /* sspad */ 0, - /* cr1 */ SPI_CR1_MSTR | +static SPIConfig hipSpiCfg = { .circular = false, + .end_cb = NULL, + .ssport = NULL, + .sspad = 0, + .cr1 = SPI_CR1_MSTR | //SPI_CR1_BR_1 // 5MHz - SPI_CR1_CPHA | SPI_CR1_BR_0 | SPI_CR1_BR_1 | SPI_CR1_BR_2, /* cr2*/ 0 }; + SPI_CR1_CPHA | SPI_CR1_BR_0 | SPI_CR1_BR_1 | SPI_CR1_BR_2, + .cr2 = 0}; #endif /* EFI_PROD_CODE */ static void checkResponse(void) { diff --git a/firmware/hw_layer/mmc_card.cpp b/firmware/hw_layer/mmc_card.cpp index 63dd2f269a..d060985db3 100644 --- a/firmware/hw_layer/mmc_card.cpp +++ b/firmware/hw_layer/mmc_card.cpp @@ -71,10 +71,20 @@ static THD_WORKING_AREA(mmcThreadStack,3 * UTILITY_THREAD_STACK_SIZE); // MMC m */ MMCDriver MMCD1; -static SPIConfig hs_spicfg = { NULL, NULL, 0, -SPI_BaudRatePrescaler_8 }; -static SPIConfig ls_spicfg = { NULL, NULL, 0, -SPI_BaudRatePrescaler_256 }; +static SPIConfig hs_spicfg = { + .circular = false, + .end_cb = NULL, + .ssport = NULL, + .sspad = 0, + .cr1 = SPI_BaudRatePrescaler_8, + .cr2 = 0}; +static SPIConfig ls_spicfg = { + .circular = false, + .end_cb = NULL, + .ssport = NULL, + .sspad = 0, + .cr1 = SPI_BaudRatePrescaler_256, + .cr2 = 0}; /* MMC/SD over SPI driver configuration.*/ // don't forget check if STM32_SPI_USE_SPI2 defined and spi has init with correct GPIO in hardware.cpp diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index 8ee7b8e814..b90188bee7 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -38,10 +38,13 @@ static THD_WORKING_AREA(cjThreadStack, UTILITY_THREAD_STACK_SIZE); static SPIDriver *driver; -static SPIConfig cj125spicfg = { /* end_cb */ NULL, - /* HW dependent part.*/ - /* ssport */ NULL, /* sspad */ 0, /* cr1 */ SPI_CR1_MSTR | SPI_CR1_CPHA, /* cr2*/ 0 }; - +static SPIConfig cj125spicfg = { + .circular = false, + .end_cb = NULL, + .ssport = NULL, + .sspad = 0, + .cr1 = SPI_CR1_MSTR | SPI_CR1_CPHA, + .cr2 = 0 }; static volatile int lastSlowAdcCounter = 0;