mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
htc: implement htclow listener thread
This commit is contained in:
parent
c9c41e0e8d
commit
2341f18edd
21 changed files with 669 additions and 11 deletions
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
#include <stratosphere.hpp>
|
||||
#include "htclow_mux.hpp"
|
||||
#include "../ctrl/htclow_ctrl_state_machine.hpp"
|
||||
|
||||
namespace ams::htclow::mux {
|
||||
|
||||
|
@ -37,4 +38,28 @@ namespace ams::htclow::mux {
|
|||
}
|
||||
}
|
||||
|
||||
void Mux::UpdateChannelState() {
|
||||
/* Lock ourselves. */
|
||||
std::scoped_lock lk(m_mutex);
|
||||
|
||||
/* Update the state of all channels in our map. */
|
||||
/* NOTE: Nintendo does this highly inefficiently... */
|
||||
for (auto pair : m_channel_impl_map.GetMap()) {
|
||||
m_channel_impl_map[pair.first].UpdateState();
|
||||
}
|
||||
}
|
||||
|
||||
void Mux::UpdateMuxState() {
|
||||
/* Lock ourselves. */
|
||||
std::scoped_lock lk(m_mutex);
|
||||
|
||||
/* Update whether we're sleeping. */
|
||||
if (m_state_machine->IsSleeping()) {
|
||||
m_is_sleeping = true;
|
||||
} else {
|
||||
m_is_sleeping = false;
|
||||
m_wake_event.Signal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue