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

27 lines
643 B
C++
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
2014-10-02 10:03:00 -07:00
* @file allsensors.cpp
2014-08-29 07:52:33 -07:00
* @brief
*
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "allsensors.h"
2014-11-07 08:08:15 -08:00
void initSensors(Engine *engine) {
initThermistors(engine);
2014-08-29 07:52:33 -07:00
}
2014-11-26 20:03:05 -08:00
// 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;
}