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
|
|
|
*/
|
|
|
|
|
2021-07-25 22:05:17 -07:00
|
|
|
#include "pch.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-11-19 20:57:06 -08:00
|
|
|
ButtonDebounce acDebounce("ac_switch");
|
2020-09-10 19:16:20 -07:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void initSensors() {
|
|
|
|
initMapDecoder();
|
2021-11-17 00:54:21 -08:00
|
|
|
acDebounce.init(15, engineConfiguration->acSwitch, engineConfiguration->acSwitchMode);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
bool getAcToggle() {
|
2020-09-10 19:16:20 -07:00
|
|
|
return acDebounce.readPinState();
|
2019-03-02 10:04:26 -08:00
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
bool hasAcToggle() {
|
2022-07-07 21:51:53 -07:00
|
|
|
return isBrainPinValid(engineConfiguration->acSwitch);
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|