fix POWER state entry/exit based on loss of USB power (tx @mc-hamster)

This commit is contained in:
Kevin Hester
2020-10-12 09:27:07 +08:00
parent 62493efc40
commit 45a36f5571
4 changed files with 43 additions and 34 deletions

View File

@@ -128,7 +128,8 @@ class PowerFSMThread : public OSThread
/// If we are in power state we force the CPU to wake every 10ms to check for serial characters (we don't yet wake
/// cpu for serial rx - FIXME)
canSleep = (powerFSM.getState() != &statePOWER);
auto state = powerFSM.getState();
canSleep = (state != &statePOWER) && (state != &stateSERIAL);
return 10;
}