htc: free ourselves from the tyranny of numerical enums

This commit is contained in:
Michael Scire authored and SciresM committed 2021-02-24 04:06:54 -08:00
1 parent 2341f18edd
commit e40eece74e
6 files changed
+131 -87

No files matched your search

@@ -87,10 +87,10 @@ namespace ams::htclow::ctrl {
/* Lock ourselves. */
std::scoped_lock lk(m_mutex);
if (m_state_machine->GetHtcctrlState() == HtcctrlState_7) {
R_TRY(this->SetState(HtcctrlState_8));
if (m_state_machine->GetHtcctrlState() == HtcctrlState_Sleep) {
R_TRY(this->SetState(HtcctrlState_ExitSleep));
} else {
R_TRY(this->SetState(HtcctrlState_0));
R_TRY(this->SetState(HtcctrlState_DriverConnected));
}
return ResultSuccess();
@@ -100,10 +100,10 @@ namespace ams::htclow::ctrl {
/* Lock ourselves. */
std::scoped_lock lk(m_mutex);
if (m_state_machine->GetHtcctrlState() == HtcctrlState_6) {
R_TRY(this->SetState(HtcctrlState_7));
if (m_state_machine->GetHtcctrlState() == HtcctrlState_EnterSleep) {
R_TRY(this->SetState(HtcctrlState_Sleep));
} else {
R_TRY(this->SetState(HtcctrlState_11));
R_TRY(this->SetState(HtcctrlState_DriverDisconnected));
}
return ResultSuccess();