auto-sync
This commit is contained in:
parent
73572657dc
commit
8b197451ed
|
@ -22,6 +22,7 @@ static LENameOrdinalPair leMaf(LE_METHOD_MAF, "maf");
|
|||
static LENameOrdinalPair leVBatt(LE_METHOD_VBATT, "vbatt");
|
||||
static LENameOrdinalPair leFan(LE_METHOD_FAN, "fan");
|
||||
static LENameOrdinalPair leCoolant(LE_METHOD_COOLANT, "coolant");
|
||||
static LENameOrdinalPair leAcToggle(LE_METHOD_AC_TOGGLE, "ac_toggle");
|
||||
static LENameOrdinalPair leFanOnSetting(LE_METHOD_FAN_ON_SETTING, "fan_on_setting");
|
||||
static LENameOrdinalPair leFanOffSetting(LE_METHOD_FAN_OFF_SETTING, "fan_off_setting");
|
||||
static LENameOrdinalPair leTimeSinceBoot(LE_METHOD_TIME_SINCE_BOOT, "time_since_boot");
|
||||
|
@ -32,6 +33,8 @@ float getLEValue(Engine *engine, le_action_e action) {
|
|||
switch (action) {
|
||||
case LE_METHOD_FAN:
|
||||
return getOutputPinValue(FAN_RELAY);
|
||||
case LE_METHOD_AC_TOGGLE:
|
||||
return getAcToggle(engine);
|
||||
case LE_METHOD_COOLANT:
|
||||
return getCoolantTemperature(engine);
|
||||
case LE_METHOD_INTAKE_AIR:
|
||||
|
|
|
@ -38,6 +38,7 @@ typedef enum {
|
|||
LE_METHOD_MAF = 107,
|
||||
LE_METHOD_INTAKE_AIR = 108,
|
||||
LE_METHOD_VBATT = 109,
|
||||
LE_METHOD_AC_TOGGLE = 110,
|
||||
|
||||
Force_4b_le_action = ENUM_SIZE_HACK,
|
||||
|
||||
|
|
|
@ -277,7 +277,9 @@ static void printAnalogChannelInfoExt(const char *name, adc_channel_e hwChannel,
|
|||
}
|
||||
|
||||
static void printAnalogChannelInfo(const char *name, adc_channel_e hwChannel) {
|
||||
printAnalogChannelInfoExt(name, hwChannel, getVoltage(hwChannel));
|
||||
if (hwChannel != EFI_ADC_NONE) {
|
||||
printAnalogChannelInfoExt(name, hwChannel, getVoltage(hwChannel));
|
||||
}
|
||||
}
|
||||
|
||||
static void printAnalogInfo(void) {
|
||||
|
@ -292,6 +294,7 @@ static void printAnalogInfo(void) {
|
|||
if (engineConfiguration->hasBaroSensor) {
|
||||
printAnalogChannelInfo("BARO", engineConfiguration->baroSensor.hwChannel);
|
||||
}
|
||||
printAnalogChannelInfo("A/C sw", engineConfiguration->acSwitchAdc);
|
||||
printAnalogChannelInfoExt("Vbatt", engineConfiguration->vbattAdcChannel, getVBatt(engineConfiguration));
|
||||
}
|
||||
|
||||
|
|
|
@ -12,3 +12,15 @@
|
|||
void initSensors(Engine *engine) {
|
||||
initThermistors(engine);
|
||||
}
|
||||
|
||||
// todo: move this somewhere else? maybe.
|
||||
bool getAcToggle(Engine *engine) {
|
||||
engine_configuration_s *engineConfiguration = engine->engineConfiguration;
|
||||
/**
|
||||
* todo: make this flexible
|
||||
*
|
||||
* for now we are looking for a pull-up. High level means input switch is floating (which is OFF position)
|
||||
* low value means input is ground - which means ON.
|
||||
*/
|
||||
return getVoltageDivided(engine->engineConfiguration->acSwitchAdc) < 2.5;
|
||||
}
|
||||
|
|
|
@ -27,4 +27,6 @@
|
|||
|
||||
void initSensors(Engine *engine);
|
||||
|
||||
bool getAcToggle(Engine *engine);
|
||||
|
||||
#endif /*SENSORS_H_*/
|
||||
|
|
Loading…
Reference in New Issue