2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file allsensors.cpp
|
|
|
|
* @brief
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @date Nov 15, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "engine.h"
|
|
|
|
#include "allsensors.h"
|
|
|
|
|
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
2020-09-10 19:16:20 -07:00
|
|
|
ButtonDebounce acDebounce;
|
|
|
|
|
2017-05-15 20:28:49 -07:00
|
|
|
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|
|
|
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
2020-09-10 19:16:20 -07:00
|
|
|
acDebounce.init(15, &CONFIG(acSwitch), &CONFIG(acSwitchMode));
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2020-09-10 19:16:20 -07:00
|
|
|
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
return acDebounce.readPinState();
|
2019-03-02 10:04:26 -08:00
|
|
|
}
|
|
|
|
|
2020-09-10 19:16:20 -07:00
|
|
|
bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
|
|
return (CONFIG(acSwitch) != GPIO_UNASSIGNED);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|