auto-sync

This commit is contained in:
rusEfi 2015-04-04 10:05:55 -05:00
parent 07e43064b7
commit a4159d891f
10 changed files with 25 additions and 23 deletions

View File

@ -68,10 +68,10 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
bc->ignitionPinMode = OM_INVERTED;
bc->ignitionPins[0] = GPIOB_5; // #1
bc->ignitionPins[1] = GPIOB_6; // #2
bc->ignitionPins[2] = GPIOB_7; // #3
bc->ignitionPins[2] = GPIOB_6; // #3
bc->ignitionPins[4] = GPIOB_7; // #5
bc->triggerErrorPin = GPIOE_3;
bc->triggerErrorPin = GPIO_UNASSIGNED;
engineConfiguration->clutchUpPin = GPIOD_3;
engineConfiguration->clutchUpPinMode = PI_PULLUP;
@ -84,6 +84,11 @@ void setBmwE34(DECLARE_ENGINE_PARAMETER_F) {
// set_idle_pwm 50
boardConfiguration->idlePosition = 50;
boardConfiguration->sdCardCsPin = GPIO_UNASSIGNED;
boardConfiguration->is_enabled_spi_2 = false;
boardConfiguration->is_enabled_spi_3 = false;
boardConfiguration->max31855spiDevice = SPI_NONE;
// turbocharger boost control solenoid: TODO output: GPIOE_6
// water injection #1 TODO GPIOD_7
// water injection #2 TODO GPIOE_2

View File

@ -199,8 +199,6 @@
//#define SPI_CS3_PIN 15
//#define SPI_CS4_PORT GPIOD
//#define SPI_CS4_PIN 10
//#define SPI_SD_MODULE_PORT GPIOD
//#define SPI_SD_MODULE_PIN 11
#define EFI_SPI1_AF 5
@ -216,8 +214,6 @@
#define SPI_CS2_PIN 0
#define SPI_CS4_PORT GPIOD
#define SPI_CS4_PIN 3
#define SPI_SD_MODULE_PORT GPIOD
#define SPI_SD_MODULE_PIN 4
#define EFI_SPI3_AF 6
#define MMC_CARD_SPI SPID3

View File

@ -560,6 +560,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->hip9011Gain = 1;
boardConfiguration->sdCardCsPin = GPIOD_4;
boardConfiguration->isSdCardEnabled = true;
boardConfiguration->isFastAdcEnabled = true;
boardConfiguration->isEngineControlEnabled = true;

View File

@ -1,4 +1,4 @@
// this section was generated by config_definition.jar on Sat Apr 04 09:37:43 EDT 2015
// this section was generated by config_definition.jar on Sat Apr 04 10:01:54 EDT 2015
// begin
#include "rusefi_types.h"
typedef struct {
@ -396,7 +396,7 @@ typedef struct {
/**
* offset 324
*/
int sdCardCsPin;
brain_pin_e sdCardCsPin;
/**
* offset 328
*/
@ -1235,4 +1235,4 @@ typedef struct {
} engine_configuration_s;
// end
// this section was generated by config_definition.jar on Sat Apr 04 09:37:43 EDT 2015
// this section was generated by config_definition.jar on Sat Apr 04 10:01:54 EDT 2015

View File

@ -12,7 +12,7 @@
#include "engine_configuration.h"
#include "engine.h"
#define FLASH_DATA_VERSION 7600
#define FLASH_DATA_VERSION 7610
void readFromFlash(void);
void initFlash(Logging *sharedLogger, Engine *engine);

View File

@ -115,7 +115,7 @@ void initOutputPins(void) {
// outputPinRegister("spi CS3", SPI_CS_3, SPI_CS3_PORT, SPI_CS3_PIN);
// outputPinRegister("spi CS4", SPI_CS_4, SPI_CS4_PORT, SPI_CS4_PIN);
#if HAL_USE_SPI || defined(__DOXYGEN__)
outputPinRegister("spi CS5", &sdCsPin, SPI_SD_MODULE_PORT, SPI_SD_MODULE_PIN);
outputPinRegisterExt2("spi CS5", &sdCsPin, boardConfiguration->sdCardCsPin, &DEFAULT_OUTPUT);
#endif
// todo: should we move this code closer to the fuel pump logic?

View File

@ -144,16 +144,13 @@ static void egtRead(void) {
void initMax31855(Logging *sharedLogger, SPIDriver *drv, egt_cs_array_t max31855_cs) {
logger = sharedLogger;
// todo:spi device is now enabled separately - should probably be enabled here
driver = drv;
addConsoleAction("egtinfo", (Void) showEgtInfo);
addConsoleAction("egtread", (Void) egtRead);
#if EFI_PROD_CODE
turnOnSpi(SPI_DEVICE_3);
#endif /* EFI_PROD_CODE */
for (int i = 0; i < EGT_CHANNEL_COUNT; i++) {
if (max31855_cs[i] != GPIO_UNASSIGNED) {

View File

@ -34,9 +34,9 @@ static THD_WORKING_AREA(mmcThreadStack,UTILITY_THREAD_STACK_SIZE); // MMC monit
*/
MMCDriver MMCD1;
static SPIConfig hs_spicfg = { NULL, SPI_SD_MODULE_PORT, SPI_SD_MODULE_PIN,
static SPIConfig hs_spicfg = { NULL, NULL, 0,
SPI_BaudRatePrescaler_8 };
static SPIConfig ls_spicfg = { NULL, SPI_SD_MODULE_PORT, SPI_SD_MODULE_PIN,
static SPIConfig ls_spicfg = { NULL, NULL, 0,
SPI_BaudRatePrescaler_256 };
/* MMC/SD over SPI driver configuration.*/
@ -64,7 +64,7 @@ static FIL FDLogFile;
static int totalLoggedBytes = 0;
static void printMmcPinout(void) {
scheduleMsg(&logger, "MMC CS %s:%d", portname(SPI_SD_MODULE_PORT), SPI_SD_MODULE_PIN);
scheduleMsg(&logger, "MMC CS %s", hwPortname(boardConfiguration->sdCardCsPin));
// todo: we need to figure out the right SPI pinout, not just SPI2
// scheduleMsg(&logger, "MMC SCK %s:%d", portname(EFI_SPI2_SCK_PORT), EFI_SPI2_SCK_PIN);
// scheduleMsg(&logger, "MMC MISO %s:%d", portname(EFI_SPI2_MISO_PORT), EFI_SPI2_MISO_PIN);
@ -256,6 +256,9 @@ void initMmcCard(void) {
return;
}
hs_spicfg.ssport = ls_spicfg.ssport = getHwPort(boardConfiguration->sdCardCsPin);
hs_spicfg.sspad = ls_spicfg.sspad = getHwPin(boardConfiguration->sdCardCsPin);
/**
* FYI: SPI does not work with CCM memory, be sure to have main() stack in RAM, not in CCMRAM
*/

View File

@ -318,7 +318,7 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fas
int idleThreadPeriod;
int consoleLoopPeriod;
int lcdThreadPeriod;
int sdCardCsPin;
brain_pin_e sdCardCsPin;
int generalPeriodicThreadPeriod;
uint32_t tunerStudioSerialSpeed;;"BPs", 1, 0, 0,1000000, 0

View File

@ -243,12 +243,12 @@ void chDbgStackOverflowPanic(Thread *otp) {
extern engine_pins_s enginePins;
// todo: why is this method here and not in error_handling.c ?
// todo: why is this method here and not in error_handling.cpp ?
void firmwareError(const char *errorMsg, ...) {
if (hasFirmwareErrorFlag)
return;
ON_FATAL_ERROR();
hasFirmwareErrorFlag = TRUE;
hasFirmwareErrorFlag = true;
if (indexOf(errorMsg, '%') == -1) {
/**
* in case of simple error message let's reduce stack usage
@ -276,5 +276,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20150403;
return 20150404;
}