auto-sync

This commit is contained in:
rusEfi 2015-01-03 22:07:07 -06:00
parent cc289c818d
commit a5cd50b59a
7 changed files with 30 additions and 12 deletions

View File

@ -69,7 +69,7 @@ void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfigurat
boardConfiguration->fanPinMode = OM_DEFAULT;
boardConfiguration->electronicThrottlePin1 = GPIO_UNASSIGNED;
boardConfiguration->idleSwitchPin = GPIO_UNASSIGNED;
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);

View File

@ -435,6 +435,10 @@ case Force_4b_pin_input_mode:
return "Force_4b_pin_input_mode";
case PI_DEFAULT:
return "PI_DEFAULT";
case PI_PULLUP:
return "PI_PULLUP";
case PI_PULLDOWN:
return "PI_PULLDOWN";
}
return NULL;
}

View File

@ -422,7 +422,8 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
boardConfiguration->fanPin = GPIOC_15;
boardConfiguration->fanPinMode = OM_DEFAULT;
boardConfiguration->idleSwitchPin = GPIO_UNASSIGNED;
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
engineConfiguration->clutchUpPin = GPIO_UNASSIGNED;
boardConfiguration->triggerSimulatorPins[0] = GPIOD_1;
boardConfiguration->triggerSimulatorPins[1] = GPIOD_2;

View File

@ -146,10 +146,13 @@ typedef struct {
pin_output_mode_e electronicThrottlePin1Mode;
/**
* Idle switch input signal
* some cars have a switch to indicate that clutch pedal is all the way down
*/
brain_pin_e idleSwitchPin;
pin_input_mode_e idleSwitchPinMode;
brain_pin_e clutchDownPin;
/**
* some cars have a switch to indicate that clutch pedal is all the way down
*/
pin_input_mode_e clutchDownPinMode;
brain_pin_e alternatorControlPin;
pin_output_mode_e alternatorControlPinMode;
@ -598,7 +601,12 @@ typedef struct {
*/
float cylinderBore;
int unused3[84];
/**
* Some vehicles have a switch to indicate that clutch pedal is all the way up
*/
brain_pin_e clutchUpPin;
pin_input_mode_e clutchUpPinMode;
int unused3[82];
} engine_configuration_s;

View File

@ -238,6 +238,8 @@ typedef enum {
typedef enum {
PI_DEFAULT = 0,
PI_PULLUP = 1,
PI_PULLDOWN = 2,
Force_4b_pin_input_mode = ENUM_SIZE_HACK,
} pin_input_mode_e;

View File

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

View File

@ -96,9 +96,9 @@ static msg_t ivThread(int param) {
chThdSleepMilliseconds(boardConfiguration->idleThreadPeriod);
// this value is not used yet
if (boardConfiguration->idleSwitchPin != GPIO_UNASSIGNED) {
idleSwitchState = palReadPad(getHwPort(boardConfiguration->idleSwitchPin),
getHwPin(boardConfiguration->idleSwitchPin));
if (boardConfiguration->clutchDownPin != GPIO_UNASSIGNED) {
idleSwitchState = palReadPad(getHwPort(boardConfiguration->clutchDownPin),
getHwPin(boardConfiguration->clutchDownPin));
}
if (engineConfiguration->idleMode != IM_AUTO)
@ -149,8 +149,11 @@ void startIdleThread(Engine *engine) {
// this is idle switch INPUT - sometimes there is a switch on the throttle pedal
// this switch is not used yet
if (boardConfiguration->idleSwitchPin != GPIO_UNASSIGNED)
mySetPadMode2("idle switch", boardConfiguration->idleSwitchPin, PAL_MODE_INPUT);
if (boardConfiguration->clutchDownPin != GPIO_UNASSIGNED)
mySetPadMode2("clutch down switch", boardConfiguration->clutchDownPin, PAL_MODE_INPUT);
if (engineConfiguration->clutchUpPin != GPIO_UNASSIGNED)
mySetPadMode2("clutch up switch", engineConfiguration->clutchUpPin, PAL_MODE_INPUT);
addConsoleAction("idleinfo", showIdleInfo);
addConsoleActionI("set_idle_rpm", setIdleRpmAction);