1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-13 23:46:40 +00:00

psc: fix pm module init

This commit is contained in:
Michael Scire 2021-02-10 02:57:22 -08:00
parent 2b825d56dc
commit fe5c850e69
2 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@
namespace ams::psc { namespace ams::psc {
enum PmModuleId : u16 { enum PmModuleId : u32 {
PmModuleId_Usb = 4, PmModuleId_Usb = 4,
PmModuleId_Ethernet = 5, PmModuleId_Ethernet = 5,
PmModuleId_Fgm = 6, PmModuleId_Fgm = 6,

View file

@ -46,9 +46,9 @@ namespace ams::psc {
Result PmModule::Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode) { Result PmModule::Initialize(const PmModuleId mid, const PmModuleId *dependencies, u32 dependency_count, os::EventClearMode clear_mode) {
R_UNLESS(!this->initialized, psc::ResultAlreadyInitialized()); R_UNLESS(!this->initialized, psc::ResultAlreadyInitialized());
static_assert(sizeof(*dependencies) == sizeof(u16)); static_assert(sizeof(*dependencies) == sizeof(u32));
::PscPmModule module; ::PscPmModule module;
R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast<const u16 *>(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear)); R_TRY(::pscmGetPmModule(std::addressof(module), static_cast<::PscPmModuleId>(mid), reinterpret_cast<const u32 *>(dependencies), dependency_count, clear_mode == os::EventClearMode_AutoClear));
this->intf = RemoteObjectFactory::CreateSharedEmplaced<psc::sf::IPmModule, RemotePmModule>(module); this->intf = RemoteObjectFactory::CreateSharedEmplaced<psc::sf::IPmModule, RemotePmModule>(module);
this->system_event.AttachReadableHandle(module.event.revent, false, clear_mode); this->system_event.AttachReadableHandle(module.event.revent, false, clear_mode);