cj125 and hip125 and else SPI broken with chibi18 migration #757
This commit is contained in:
parent
cedcd5fcf2
commit
f6eb829fef
|
@ -27,7 +27,7 @@ endif
|
||||||
|
|
||||||
# Compiler options here.
|
# Compiler options here.
|
||||||
ifeq ($(USE_OPT),)
|
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
|
endif
|
||||||
|
|
||||||
# C specific options here (added to USE_OPT).
|
# C specific options here (added to USE_OPT).
|
||||||
|
|
|
@ -135,6 +135,9 @@ ADC_TwoSamplingDelay_20Cycles, // cr1
|
||||||
|
|
||||||
, // In this field must be specified the sample times for channels 0...9
|
, // 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 13...16 + sequence length
|
||||||
0, // Conversion group sequence 7...12
|
0, // Conversion group sequence 7...12
|
||||||
0 // Conversion group sequence 1...6
|
0 // Conversion group sequence 1...6
|
||||||
|
@ -170,6 +173,9 @@ ADC_TwoSamplingDelay_5Cycles, // cr1
|
||||||
ADC_SMPR2_SMP_AN8(ADC_SAMPLING_FAST) |
|
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
|
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 13...16 + sequence length
|
||||||
|
|
||||||
0, // Conversion group sequence 7...12
|
0, // Conversion group sequence 7...12
|
||||||
|
|
|
@ -84,12 +84,14 @@ static Logging *logger;
|
||||||
// todo: nicer method which would mention SPI speed explicitly?
|
// todo: nicer method which would mention SPI speed explicitly?
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
static SPIConfig hipSpiCfg = { /* end_cb */ NULL,
|
static SPIConfig hipSpiCfg = { .circular = false,
|
||||||
/* HW dependent part.*/
|
.end_cb = NULL,
|
||||||
/* ssport */ NULL, /* sspad */ 0,
|
.ssport = NULL,
|
||||||
/* cr1 */ SPI_CR1_MSTR |
|
.sspad = 0,
|
||||||
|
.cr1 = SPI_CR1_MSTR |
|
||||||
//SPI_CR1_BR_1 // 5MHz
|
//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 */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
static void checkResponse(void) {
|
static void checkResponse(void) {
|
||||||
|
|
|
@ -71,10 +71,20 @@ static THD_WORKING_AREA(mmcThreadStack,3 * UTILITY_THREAD_STACK_SIZE); // MMC m
|
||||||
*/
|
*/
|
||||||
MMCDriver MMCD1;
|
MMCDriver MMCD1;
|
||||||
|
|
||||||
static SPIConfig hs_spicfg = { NULL, NULL, 0,
|
static SPIConfig hs_spicfg = {
|
||||||
SPI_BaudRatePrescaler_8 };
|
.circular = false,
|
||||||
static SPIConfig ls_spicfg = { NULL, NULL, 0,
|
.end_cb = NULL,
|
||||||
SPI_BaudRatePrescaler_256 };
|
.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.*/
|
/* 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
|
// don't forget check if STM32_SPI_USE_SPI2 defined and spi has init with correct GPIO in hardware.cpp
|
||||||
|
|
|
@ -38,10 +38,13 @@ static THD_WORKING_AREA(cjThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||||
|
|
||||||
static SPIDriver *driver;
|
static SPIDriver *driver;
|
||||||
|
|
||||||
static SPIConfig cj125spicfg = { /* end_cb */ NULL,
|
static SPIConfig cj125spicfg = {
|
||||||
/* HW dependent part.*/
|
.circular = false,
|
||||||
/* ssport */ NULL, /* sspad */ 0, /* cr1 */ SPI_CR1_MSTR | SPI_CR1_CPHA, /* cr2*/ 0 };
|
.end_cb = NULL,
|
||||||
|
.ssport = NULL,
|
||||||
|
.sspad = 0,
|
||||||
|
.cr1 = SPI_CR1_MSTR | SPI_CR1_CPHA,
|
||||||
|
.cr2 = 0 };
|
||||||
|
|
||||||
static volatile int lastSlowAdcCounter = 0;
|
static volatile int lastSlowAdcCounter = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue