auto-sync

This commit is contained in:
rusEfi 2014-12-25 18:03:21 -06:00
parent 5f662b30db
commit 79c9ac722e
9 changed files with 59 additions and 47 deletions

View File

@ -314,7 +314,7 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat
#endif
engineConfiguration->cylinderBore = 87.5;
engineConfiguration->isCanEnabled = true;
// engineConfiguration->isCanEnabled = true;
boardConfiguration->canTxPin = GPIOB_6;
boardConfiguration->canRxPin = GPIOB_12;
engineConfiguration->canWriteEnabled = true;

View File

@ -186,21 +186,8 @@
//#define SPI_SD_MODULE_PORT GPIOD
//#define SPI_SD_MODULE_PIN 11
#define EFI_SPI1_SCK_PORT GPIOB
#define EFI_SPI1_SCK_PIN 3
#define EFI_SPI1_MISO_PORT GPIOB
#define EFI_SPI1_MISO_PIN 4
#define EFI_SPI1_MOSI_PORT GPIOB
#define EFI_SPI1_MOSI_PIN 5
#define EFI_SPI1_AF 5
#define EFI_SPI2_SCK_PORT GPIOB
#define EFI_SPI2_SCK_PIN 13
#define EFI_SPI2_MISO_PORT GPIOB
#define EFI_SPI2_MISO_PIN 14
#define EFI_SPI2_MOSI_PORT GPIOB
#define EFI_SPI2_MOSI_PIN 15
#define EFI_SPI2_AF 5
@ -215,12 +202,6 @@
#define SPI_CS4_PIN 3
#define SPI_SD_MODULE_PORT GPIOD
#define SPI_SD_MODULE_PIN 4
#define EFI_SPI3_SCK_PORT GPIOB
#define EFI_SPI3_SCK_PIN 3
#define EFI_SPI3_MISO_PORT GPIOB
#define EFI_SPI3_MISO_PIN 4
#define EFI_SPI3_MOSI_PORT GPIOB
#define EFI_SPI3_MOSI_PIN 5
#define EFI_SPI3_AF 6
#define MMC_CARD_SPI SPID3

View File

@ -14,7 +14,7 @@
/**
* this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version
*/
#define TS_FILE_VERSION 20141103
#define TS_FILE_VERSION 20141225
#define PAGE_0_SIZE 10008
#define TS_OUTPUT_SIZE 116

View File

@ -485,6 +485,18 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
boardConfiguration->is_enabled_spi_2 = false;
boardConfiguration->is_enabled_spi_3 = true;
boardConfiguration->spi1mosiPin = GPIOB_5;
boardConfiguration->spi1misoPin = GPIOB_4;
boardConfiguration->spi1sckPin = GPIOB_3;
boardConfiguration->spi2mosiPin = GPIOB_15;
boardConfiguration->spi2misoPin = GPIOB_14;
boardConfiguration->spi2sckPin = GPIOB_13;
boardConfiguration->spi3mosiPin = GPIOB_5;
boardConfiguration->spi3misoPin = GPIOB_4;
boardConfiguration->spi3sckPin = GPIOB_3;
boardConfiguration->isSdCardEnabled = false;
boardConfiguration->isFastAdcEnabled = false;
boardConfiguration->isEngineControlEnabled = true;

View File

@ -246,7 +246,17 @@ typedef struct {
brain_pin_e hip9011OutPin;
float fsio_setting[LE_COMMAND_COUNT];
int unusedbs[22];
brain_pin_e spi1mosiPin;
brain_pin_e spi1misoPin;
brain_pin_e spi1sckPin;
brain_pin_e spi2mosiPin;
brain_pin_e spi2misoPin;
brain_pin_e spi2sckPin;
brain_pin_e spi3mosiPin;
brain_pin_e spi3misoPin;
brain_pin_e spi3sckPin;
int unusedbs[13];
le_formula_t le_formulas[LE_COMMAND_COUNT];
@ -397,8 +407,7 @@ typedef struct {
*/
float fanOffTemperature;
int canReadEnabled;
int canWriteEnabled;
int unusedTwoInts[2];
// offset 968
can_nbc_e canNbcType;
// offset 972
@ -436,6 +445,7 @@ typedef struct {
spi_device_e hip9011SpiDevice;
adc_channel_e vbattAdcChannel;
// offset 1060
float globalFuelCorrection;
// todo: merge with channel settings, use full-scale Thermistor!
@ -473,6 +483,7 @@ typedef struct {
board_configuration_s bc;
// offset 6280
/**
* @see isMapAveragingEnabled
*/
@ -483,8 +494,11 @@ typedef struct {
bool_t useConstantDwellDuringCranking : 1; // bit 3
bool_t isDigitalChartEnabled : 1; // bit 4
bool_t isCanEnabled : 1; // bit 5
// that's the next 32 bit field
int hasCltSensor;
bool_t hasCltSensor : 1; // bit 6
bool_t canReadEnabled : 1; // bit 7
bool_t canWriteEnabled : 1; // bit 8
int unused6284;
idle_mode_e idleMode;

View File

@ -16,7 +16,6 @@
#if EFI_INTERNAL_FLASH
#include "engine_controller.h"
#include "datalogging.h"

View File

@ -12,7 +12,7 @@
#include "engine_configuration.h"
#include "engine.h"
#define FLASH_DATA_VERSION 5590
#define FLASH_DATA_VERSION 5932
void readFromFlash(void);
void initFlash(Engine *engine);

View File

@ -40,7 +40,7 @@
#include "engine_configuration.h"
#include "ec2.h"
extern engine_configuration2_s * engineConfiguration2;
EXTERN_ENGINE;
extern bool hasFirmwareErrorFlag;
static StepperMotor iacMotor;
@ -50,12 +50,14 @@ static Mutex spiMtx;
#if HAL_USE_SPI || defined(__DOXYGEN__)
static bool isSpiInitialized[5] = { false, false, false, false, false };
static void initSpiModule(SPIDriver *driver, ioportid_t sckPort, ioportmask_t sckPin, ioportid_t misoPort,
ioportmask_t misoPin, ioportid_t mosiPort, ioportmask_t mosiPin, int af) {
mySetPadMode("SPI clock", sckPort, sckPin, PAL_MODE_ALTERNATE(af));
static void initSpiModule(SPIDriver *driver, brain_pin_e sck, brain_pin_e miso,
brain_pin_e mosi, int af) {
mySetPadMode("SPI master out", mosiPort, mosiPin, PAL_MODE_ALTERNATE(af));
mySetPadMode("SPI master in ", misoPort, misoPin, PAL_MODE_ALTERNATE(af));
mySetPadMode("SPI clock", getHwPort(sck), getHwPin(sck), PAL_MODE_ALTERNATE(af));
mySetPadMode("SPI master out", getHwPort(mosi), getHwPin(mosi), PAL_MODE_ALTERNATE(af));
mySetPadMode("SPI master in ", getHwPort(miso), getHwPin(miso), PAL_MODE_ALTERNATE(af));
}
/**
@ -78,9 +80,9 @@ void turnOnSpi(spi_device_e device) {
#if STM32_SPI_USE_SPI1
// scheduleMsg(&logging, "Turning on SPI1 pins");
initSpiModule(&SPID1,
EFI_SPI1_SCK_PORT, EFI_SPI1_SCK_PIN,
EFI_SPI1_MISO_PORT, EFI_SPI1_MISO_PIN,
EFI_SPI1_MOSI_PORT, EFI_SPI1_MOSI_PIN,
boardConfiguration->spi1sckPin,
boardConfiguration->spi1misoPin,
boardConfiguration->spi1mosiPin,
EFI_SPI1_AF);
#endif
}
@ -88,9 +90,9 @@ void turnOnSpi(spi_device_e device) {
#if STM32_SPI_USE_SPI2
// scheduleMsg(&logging, "Turning on SPI2 pins");
initSpiModule(&SPID2,
EFI_SPI2_SCK_PORT, EFI_SPI2_SCK_PIN,
EFI_SPI2_MISO_PORT, EFI_SPI2_MISO_PIN,
EFI_SPI2_MOSI_PORT, EFI_SPI2_MOSI_PIN,
boardConfiguration->spi2sckPin,
boardConfiguration->spi2misoPin,
boardConfiguration->spi2mosiPin,
EFI_SPI2_AF);
#endif
}
@ -98,9 +100,9 @@ void turnOnSpi(spi_device_e device) {
#if STM32_SPI_USE_SPI3
// scheduleMsg(&logging, "Turning on SPI3 pins");
initSpiModule(&SPID3,
EFI_SPI3_SCK_PORT, EFI_SPI3_SCK_PIN,
EFI_SPI3_MISO_PORT, EFI_SPI3_MISO_PIN,
EFI_SPI3_MOSI_PORT, EFI_SPI3_MOSI_PIN,
boardConfiguration->spi3sckPin,
boardConfiguration->spi3misoPin,
boardConfiguration->spi3mosiPin,
EFI_SPI3_AF);
#endif
}

View File

@ -118,8 +118,6 @@ enable2ndByteCanID = false
VBattDividerCoefficient = scalar, F32, 948, "coef", 1, 0, 0.01, 20.0, 2 ; size 4
FanONTemperature = scalar, F32, 952, "°C", 1, 0, 0, 1000.0, 2 ; size 4
FanOffTemperature = scalar, F32, 956, "°C", 1, 0, 0, 1000.0, 2 ; size 4
canReadEnabled = bits, U32, 960, [0:0], "false", "true"
canWriteEnabled = bits, U32, 964, [0:0], "false", "true"
; canNbcType = bits, U32, 968, [0:1], "BMW", "FIAT", "VAG" , "INVALID"
canSleepPeriod = scalar, F32, 972, "RPM", 1, 0, 0, 1000.0, 2 ; size 4
nCylinders = bits, U32, 976, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
@ -354,7 +352,13 @@ enable2ndByteCanID = false
fsio_setting15 = scalar, F32, 6188, "Val", 1, 0, 0, 18000, 0 ; size 4
useConstantDwellDuringCranking= bits, U32, 6280, [3:3], "false", "true"
; hasCltSensor 6284
isCanEnabled = bits, U32, 6280, [5:5], "false", "true"
hasCltSensor = bits, U32, 6280, [6:6], "false", "true"
canReadEnabled = bits, U32, 6280, [7:7], "false", "true"
canWriteEnabled = bits, U32, 6280, [8:8], "false", "true"
; hasCltSensor
; unused 6284
; idleMode 6288
isInjectionEnabled = bits, U32, 6292, [0:0], "false", "true"
@ -398,7 +402,7 @@ enable2ndByteCanID = false
[OutputChannels]
; see TS_FILE_VERSION in firmware code
fileVersion = { 20141103 }
fileVersion = { 20141225 }
ochGetCommand = "O"