cj125 and hip125 and else SPI broken with chibi18 migration #757

This commit is contained in:
rusefi 2019-04-14 18:09:58 -04:00
parent cedcd5fcf2
commit f6eb829fef
5 changed files with 35 additions and 14 deletions

View File

@ -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).

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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;