Add GetModule() helper functions, for HID, CAM, and CFG

This commit is contained in:
B3n30 2018-10-12 11:50:50 +02:00
parent 1b1de23a98
commit eb3af0f16a
12 changed files with 49 additions and 51 deletions

View file

@ -390,6 +390,13 @@ void Module::ReloadInputDevices() {
is_device_reload_pending.store(true);
}
std::shared_ptr<Module> GetModule(Core::System& system) {
auto hid = system.ServiceManager().GetService<Service::HID::Module::Interface>("hid:USER");
if (!hid)
return nullptr;
return hid->GetModule();
}
void InstallInterfaces(Core::System& system) {
auto& service_manager = system.ServiceManager();
auto hid = std::make_shared<Module>(system);

View file

@ -337,5 +337,7 @@ private:
std::unique_ptr<Input::TouchDevice> touch_device;
};
std::shared_ptr<Module> GetModule(Core::System& system);
void InstallInterfaces(Core::System& system);
} // namespace Service::HID