rusefi-1/firmware/controllers/sensors/allsensors.cpp

31 lines
790 B
C++
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file allsensors.cpp
* @brief
*
*
* @date Nov 15, 2013
2018-01-20 17:55:31 -08:00
* @author Andrey Belomutskiy, (c) 2012-2018
2015-07-10 06:01:56 -07:00
*/
#include "engine.h"
#include "allsensors.h"
EXTERN_ENGINE;
2017-05-15 20:28:49 -07:00
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
initThermistors(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
2018-01-23 05:34:18 -08:00
initFlexFuelSensor();
2015-07-10 06:01:56 -07:00
}
// todo: move this somewhere else? maybe.
2017-05-15 20:28:49 -07:00
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
2015-07-10 06:01:56 -07:00
/**
* 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("A/C", engine->engineConfigurationPtr->acSwitchAdc) < 2.5;
2015-07-10 06:01:56 -07:00
}