started implementing backlight tracking (unfinished)

horus touch driver internally tracks touch state and returns the state on read to make in independed of the mainwindow touchState
This commit is contained in:
gagarinlg
2021-11-16 11:21:04 +10:00
committed by Peter Feerick
parent 52013da098
commit ced9df9510
6 changed files with 50 additions and 35 deletions
+8
View File
@@ -43,6 +43,7 @@ extern "C" {
extern void flysky_hall_stick_init( void );
HardwareOptions hardwareOptions;
bool boardBacklightOn = false;
void watchdogInit(unsigned int duration)
{
@@ -330,3 +331,10 @@ uint16_t getBatteryVoltage()
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
return (uint16_t)((instant_vbat * (1000 + g_eeGeneral.txVoltageCalibration)) / BATTERY_DIVIDER);
}
bool isBacklightEnabled()
{
if(globalData.unexpectedShutdown)
return true;
return boardBacklightOn;
}