reducing warning noise

This commit is contained in:
rusEfi 2019-03-02 13:04:26 -05:00
parent e452b6802b
commit 27bf22f704
3 changed files with 8 additions and 1 deletions

View File

@ -295,7 +295,9 @@ private:
if (CONFIGB(clutchDownPin) != GPIO_UNASSIGNED) { if (CONFIGB(clutchDownPin) != GPIO_UNASSIGNED) {
engine->clutchDownState = efiReadPin(CONFIGB(clutchDownPin)); engine->clutchDownState = efiReadPin(CONFIGB(clutchDownPin));
} }
engine->acSwitchState = getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE); if (hasAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE)) {
engine->acSwitchState = getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE);
}
if (CONFIGB(clutchUpPin) != GPIO_UNASSIGNED) { if (CONFIGB(clutchUpPin) != GPIO_UNASSIGNED) {
engine->clutchUpState = efiReadPin(CONFIGB(clutchUpPin)); engine->clutchUpState = efiReadPin(CONFIGB(clutchUpPin));
} }

View File

@ -18,6 +18,10 @@ void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
initFlexFuelSensor(); initFlexFuelSensor();
} }
bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
return engineConfiguration->acSwitchAdc != EFI_ADC_NONE;
}
// todo: move this somewhere else? maybe. // todo: move this somewhere else? maybe.
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/** /**

View File

@ -27,6 +27,7 @@
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE);
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE); bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE);
#endif /*SENSORS_H_*/ #endif /*SENSORS_H_*/