30 lines
643 B
C++
30 lines
643 B
C++
/**
|
|
* @file allsensors.cpp
|
|
* @brief
|
|
*
|
|
*
|
|
* @date Nov 15, 2013
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
*/
|
|
|
|
#include "engine.h"
|
|
#include "pin_repository.h"
|
|
#include "allsensors.h"
|
|
|
|
EXTERN_ENGINE;
|
|
|
|
ButtonDebounce acDebounce("ac_switch");
|
|
|
|
void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
|
initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
|
acDebounce.init(15, CONFIG(acSwitch), CONFIG(acSwitchMode));
|
|
}
|
|
|
|
bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
return acDebounce.readPinState();
|
|
}
|
|
|
|
bool hasAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
return (isBrainPinValid(CONFIG(acSwitch)));
|
|
}
|