auto-sync

This commit is contained in:
rusEfi 2014-12-29 22:03:34 -06:00
parent 665cf3d575
commit c6a2807137
5 changed files with 15 additions and 0 deletions

View File

@ -367,6 +367,8 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat
engineConfiguration->fanOnTemperature = 85;
engineConfiguration->fanOffTemperature = 80;
boardConfiguration->tunerStudioSerialSpeed = 9600;
// todo: ALGO = SD
// engineConfiguration->isCanEnabled = true;
boardConfiguration->canTxPin = GPIOB_6;

View File

@ -379,6 +379,8 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_
boardConfiguration->joystickPins[i] = GPIO_UNASSIGNED;
}
boardConfiguration->mainRelayPin = GPIO_UNASSIGNED;
boardConfiguration->mainRelayPinMode = OM_DEFAULT;
boardConfiguration->idleValvePin = GPIOE_2;
boardConfiguration->idleValvePinMode = OM_DEFAULT;
boardConfiguration->fuelPumpPin = GPIOC_13;

View File

@ -184,6 +184,7 @@ typedef struct {
int tunerStudioThreadPeriod;
int generalPeriodicThreadPeriod;
// offset 5796
uint32_t tunerStudioSerialSpeed;
brain_pin_e boardTestModeJumperPin;

View File

@ -290,6 +290,12 @@ void runFsio(void) {
}
#endif
/**
* main relay is always on if ECU is on, that's a good enough initial implementation
*/
if (boardConfiguration->mainRelayPin != GPIO_UNASSIGNED)
setOutputPinValue(MAIN_RELAY, 1);
if (boardConfiguration->acRelayPin != GPIO_UNASSIGNED) {
setPinState(AC_RELAY, acRelayLogic, engine);
}

View File

@ -92,6 +92,8 @@ ioportmask_t getHwPin(brain_pin_e brainPin) {
}
void outputPinRegisterExt2(const char *msg, io_pin_e ioPin, brain_pin_e brainPin, pin_output_mode_e *outputMode) {
if (brainPin == GPIO_UNASSIGNED)
return;
GPIO_TypeDef *hwPort = getHwPort(brainPin);
int hwPin = getHwPin(brainPin);
@ -150,6 +152,8 @@ void initOutputPins(void) {
// todo: should we move this code closer to the fuel pump logic?
outputPinRegisterExt2("fuel pump relay", FUEL_PUMP_RELAY, boardConfiguration->fuelPumpPin, &DEFAULT_OUTPUT);
outputPinRegisterExt2("main relay", MAIN_RELAY, boardConfiguration->mainRelayPin, &boardConfiguration->mainRelayPinMode);
outputPinRegisterExt2("fan relay", FAN_RELAY, boardConfiguration->fanPin, &DEFAULT_OUTPUT);
outputPinRegisterExt2("o2 heater", O2_HEATER, boardConfiguration->o2heaterPin, &DEFAULT_OUTPUT);
outputPinRegisterExt2("trg_err", LED_TRIGGER_ERROR, boardConfiguration->triggerErrorPin, &boardConfiguration->triggerErrorPinMode);