#495 todo clean-up
This commit is contained in:
parent
85a1ccb1ef
commit
2bc7dc9eff
|
@ -218,8 +218,6 @@
|
|||
*/
|
||||
|
||||
#define EFI_SPI3_AF 6
|
||||
// todo: finish migration to sdCardSpiDevice one day
|
||||
#define MMC_CARD_SPI SPID3
|
||||
|
||||
#define EFI_I2C_SCL_BRAIN_PIN GPIOB_6
|
||||
|
||||
|
|
|
@ -214,8 +214,6 @@
|
|||
*/
|
||||
|
||||
#define EFI_SPI3_AF 6
|
||||
// todo: finish migration to sdCardSpiDevice one day
|
||||
#define MMC_CARD_SPI SPID3
|
||||
|
||||
#define EFI_I2C_SCL_BRAIN_PIN GPIOB_6
|
||||
|
||||
|
|
|
@ -292,6 +292,7 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) {
|
|||
|
||||
engineConfiguration->sdCardSpiDevice = SPI_NONE;
|
||||
boardConfiguration->sdCardCsPin = GPIO_UNASSIGNED;
|
||||
engineConfiguration->accelerometerSpiDevice = SPI_DEVICE_1;
|
||||
|
||||
engineConfiguration->cj125ua = EFI_ADC_NONE;
|
||||
engineConfiguration->cj125ur = EFI_ADC_NONE;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 13:55:54 EST 2017
|
||||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 15:18:42 EST 2017
|
||||
// begin
|
||||
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
|
||||
#define ENGINE_CONFIGURATION_GENERATED_H_
|
||||
|
@ -1949,7 +1949,11 @@ typedef struct {
|
|||
/**
|
||||
* offset 2916
|
||||
*/
|
||||
int unusedEnd[939];
|
||||
spi_device_e accelerometerSpiDevice;
|
||||
/**
|
||||
* offset 2920
|
||||
*/
|
||||
int unusedEnd[938];
|
||||
/** total size 6672*/
|
||||
} engine_configuration_s;
|
||||
|
||||
|
@ -2164,4 +2168,4 @@ typedef struct {
|
|||
|
||||
#endif
|
||||
// end
|
||||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 13:55:54 EST 2017
|
||||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 15:18:42 EST 2017
|
||||
|
|
|
@ -1448,8 +1448,10 @@
|
|||
#define oilPressure_v2_offset_hex b5c
|
||||
#define oilPressure_value2_offset 2912
|
||||
#define oilPressure_value2_offset_hex b60
|
||||
#define unusedEnd_offset 2916
|
||||
#define unusedEnd_offset_hex b64
|
||||
#define accelerometerSpiDevice_offset 2916
|
||||
#define accelerometerSpiDevice_offset_hex b64
|
||||
#define unusedEnd_offset 2920
|
||||
#define unusedEnd_offset_hex b68
|
||||
#define fsioFormulas1_offset 6672
|
||||
#define fsioFormulas1_offset_hex 1a10
|
||||
#define fsioFormulas2_offset 6872
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
EXTERN_ENGINE;
|
||||
|
||||
#if EFI_MEMS || defined(__DOXYGEN__)
|
||||
static SPIDriver *driver = &SPID1; // todo: make this configurable
|
||||
static spi_device_e device = SPI_DEVICE_1;
|
||||
static SPIDriver *driver;
|
||||
|
||||
/*
|
||||
* SPI1 configuration structure.
|
||||
|
@ -78,9 +77,9 @@ void initAccelerometer(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
if (!boardConfiguration->is_enabled_spi_1)
|
||||
return; // temporary
|
||||
// todo: driver = getSpiDevice(device);
|
||||
driver = getSpiDevice(engineConfiguration->accelerometerSpiDevice);
|
||||
|
||||
turnOnSpi(device);
|
||||
turnOnSpi(engineConfiguration->accelerometerSpiDevice);
|
||||
spiStart(driver, &accelerometerCfg);
|
||||
initSpiCs((SPIConfig *)driver->config, engineConfiguration->LIS302DLCsPin);
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ SPI_BaudRatePrescaler_256 };
|
|||
|
||||
/* 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
|
||||
static MMCConfig mmccfg = { &MMC_CARD_SPI, &ls_spicfg, &hs_spicfg };
|
||||
static MMCConfig mmccfg = { NULL, &ls_spicfg, &hs_spicfg };
|
||||
|
||||
#define FILE_LOG_DELAY 200
|
||||
|
||||
|
@ -433,9 +433,7 @@ void initMmcCard(void) {
|
|||
|
||||
hs_spicfg.ssport = ls_spicfg.ssport = getHwPort("mmc", boardConfiguration->sdCardCsPin);
|
||||
hs_spicfg.sspad = ls_spicfg.sspad = getHwPin("mmc", boardConfiguration->sdCardCsPin);
|
||||
/* todo: un-comment this one day. incompatible configuration change for existing users :(
|
||||
mmccfg.spip = getSpiDevice(engineConfiguration->sdCardSpiDevice);
|
||||
*/
|
||||
|
||||
/**
|
||||
* FYI: SPI does not work with CCM memory, be sure to have main() stack in RAM, not in CCMRAM
|
||||
|
|
|
@ -27,12 +27,8 @@ static Logging *logger;
|
|||
static unsigned char tx_buff[1];
|
||||
static unsigned char rx_buff[1];
|
||||
|
||||
|
||||
static THD_WORKING_AREA(cjThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||
|
||||
// todo: make this configurable
|
||||
spi_device_e cj125SpiDevice = SPI_DEVICE_2;
|
||||
|
||||
static SPIDriver *driver;
|
||||
|
||||
|
||||
|
|
|
@ -826,7 +826,8 @@ brain_pin_e brakePedalPin
|
|||
|
||||
oil_pressure_config_s oilPressure;
|
||||
|
||||
int[939] unusedEnd;
|
||||
spi_device_e accelerometerSpiDevice;
|
||||
int[938] unusedEnd;
|
||||
|
||||
|
||||
end_struct
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config;
|
||||
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 13:55:54 EST 2017
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Nov 19 15:18:42 EST 2017
|
||||
public class Fields {
|
||||
public static final int LE_COMMAND_LENGTH = 200;
|
||||
public static final int BLOCKING_FACTOR = 400;
|
||||
|
@ -972,7 +972,8 @@ public class Fields {
|
|||
public static final int oilPressure_value1_offset = 2904;
|
||||
public static final int oilPressure_v2_offset = 2908;
|
||||
public static final int oilPressure_value2_offset = 2912;
|
||||
public static final int unusedEnd_offset = 2916;
|
||||
public static final int accelerometerSpiDevice_offset = 2916;
|
||||
public static final int unusedEnd_offset = 2920;
|
||||
public static final int fsioFormulas1_offset = 6672;
|
||||
public static final int fsioFormulas2_offset = 6872;
|
||||
public static final int fsioFormulas3_offset = 7072;
|
||||
|
@ -1749,6 +1750,7 @@ public class Fields {
|
|||
public static final Field OILPRESSURE_VALUE1 = Field.create("OILPRESSURE_VALUE1", 2904, FieldType.FLOAT);
|
||||
public static final Field OILPRESSURE_V2 = Field.create("OILPRESSURE_V2", 2908, FieldType.FLOAT);
|
||||
public static final Field OILPRESSURE_VALUE2 = Field.create("OILPRESSURE_VALUE2", 2912, FieldType.FLOAT);
|
||||
public static final Field ACCELEROMETERSPIDEVICE = Field.create("ACCELEROMETERSPIDEVICE", 2916, FieldType.INT);
|
||||
public static final Field FSIOFORMULAS1 = Field.create("FSIOFORMULAS1", 6672, FieldType.INT);
|
||||
public static final Field FSIOFORMULAS2 = Field.create("FSIOFORMULAS2", 6872, FieldType.INT);
|
||||
public static final Field FSIOFORMULAS3 = Field.create("FSIOFORMULAS3", 7072, FieldType.INT);
|
||||
|
|
Loading…
Reference in New Issue