auto-sync

This commit is contained in:
rusEfi 2014-11-29 10:03:49 -06:00
parent 72607fc12c
commit 6b8aa569e0
7 changed files with 15 additions and 6 deletions

View File

@ -37,8 +37,8 @@ case GPIO_7:
return "GPIO_7";
case FAN_RELAY:
return "FAN_RELAY";
case AC_RElAY:
return "AC_RElAY";
case AC_RELAY:
return "AC_RELAY";
case INJECTOR_8_OUTPUT:
return "INJECTOR_8_OUTPUT";
case GPIO_6:

View File

@ -124,7 +124,7 @@ typedef enum {
FUEL_PUMP_RELAY,
FAN_RELAY,
O2_HEATER,
AC_RElAY,
AC_RELAY,
SPI_CS_1,
SPI_CS_2,

View File

@ -18,6 +18,8 @@
// todo: the delay should probably be configurable?
#define FUEL_PUMP_LOGIC "time_since_boot 4 < rpm 0 > OR"
#define AC_RELAY_LOGIC "ac_on_switch"
/**
* In human language that's
* (fan and (coolant > fan_off_setting)) OR (coolant > fan_on_setting)

View File

@ -61,6 +61,7 @@ static LECalculator calc;
static LEElement mainPool[LE_ELEMENT_POOL_SIZE];
static LEElementPool lePool(mainPool, LE_ELEMENT_POOL_SIZE);
static LEElement * acRelayLogic;
static LEElement * fuelPumpLogic;
static LEElement * radiatorFanLogic;
@ -242,6 +243,10 @@ static void onEvenyGeneralMilliseconds(Engine *engine) {
}
#endif
if (boardConfiguration->acRelayPin != GPIO_UNASSIGNED) {
setPinState(AC_RELAY, acRelayLogic, engine);
}
updateErrorCodes();
// todo: migrate this to flex logic
@ -408,6 +413,8 @@ void initEngineContoller(Engine *engine) {
fuelPumpLogic = lePool.parseExpression(FUEL_PUMP_LOGIC);
#endif
acRelayLogic = lePool.parseExpression(AC_RELAY_LOGIC);
addConsoleAction("analoginfo", printAnalogInfo);
for (int i = 0; i < LE_COMMAND_COUNT; i++) {

View File

@ -332,7 +332,7 @@ static void printTemperatureInfo(void) {
scheduleMsg(&logger, "fan=%s @ %s", boolToString(getOutputPinValue(FAN_RELAY)),
hwPortname(boardConfiguration->fanPin));
scheduleMsg(&logger, "A/C relay=%s @ %s", boolToString(getOutputPinValue(AC_RElAY)),
scheduleMsg(&logger, "A/C relay=%s @ %s", boolToString(getOutputPinValue(AC_RELAY)),
hwPortname(boardConfiguration->acRelayPin));

View File

@ -156,7 +156,7 @@ void initOutputPins(void) {
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);
outputPinRegisterExt2("A/C relay", AC_RElAY, boardConfiguration->acRelayPin, &boardConfiguration->acRelayPinMode);
outputPinRegisterExt2("A/C relay", AC_RELAY, boardConfiguration->acRelayPin, &boardConfiguration->acRelayPinMode);
initialLedsBlink();

View File

@ -265,5 +265,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20141126;
return 20141129;
}