Skip to content

Commit

Permalink
chore: trainerInputValidityTimer has moved
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick committed Aug 22, 2024
1 parent 17d3eec commit 812f0e0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions radio/src/edgetx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1656,16 +1656,14 @@ bool pwrOffDueToInactivity()

tmr10ms_t currentTime = get_tmr10ms();

if (
TELEMETRY_STREAMING() ||
(usbPlugged() && getSelectedUsbMode() != USB_UNSELECTED_MODE) ||
trainerInputValidityTimer != 0 // previously IS_TRAINER_INPUT_VALID()
)
if (TELEMETRY_STREAMING() ||
(usbPlugged() && getSelectedUsbMode() != USB_UNSELECTED_MODE) ||
isTrainerValid())
lastConnectedTime = currentTime;

bool inactivityShutdown = inactivityLimit &&
inactivity.counter > 60u*inactivityLimit &&
(currentTime-lastConnectedTime)/100u > 60u*inactivityLimit;
bool inactivityShutdown =
inactivityLimit && inactivity.counter > 60u * inactivityLimit &&
(currentTime - lastConnectedTime) / 100u > 60u * inactivityLimit;

return inactivityShutdown;
}
Expand Down

0 comments on commit 812f0e0

Please sign in to comment.