Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cathery committed Nov 25, 2019
1 parent 7356a74 commit 3ff5734
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ControllerUSB/source/Controllers/Dualshock3Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ Result Dualshock3Controller::OpenInterfaces()
if (R_FAILED(rc))
return rc;

if (interface->GetDescriptor()->bInterfaceClass != 3)
continue;

if (interface->GetDescriptor()->bInterfaceProtocol != 0)
continue;

if (interface->GetDescriptor()->bNumEndpoints < 2)
continue;

Expand Down
4 changes: 2 additions & 2 deletions SwitchUSB/include/SwitchUSBInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
class SwitchUSBInterface : public IUSBInterface
{
private:
UsbHsClientIfSession m_session{};
UsbHsInterface m_interface{};
UsbHsClientIfSession m_session;
UsbHsInterface m_interface;

std::array<std::unique_ptr<IUSBEndpoint>, 15> m_inEndpoints;
std::array<std::unique_ptr<IUSBEndpoint>, 15> m_outEndpoints;
Expand Down
2 changes: 1 addition & 1 deletion SwitchUSB/source/SwitchUSBInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Result SwitchUSBInterface::Open()
UsbHsClientIfSession temp;
Result rc = usbHsAcquireUsbIf(&temp, &m_interface);
if (R_FAILED(rc))
return 11037;
return rc;

m_session = temp;

Expand Down
6 changes: 3 additions & 3 deletions source/mainLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Result mainLoop()
else
{

UsbHsInterface interfaces[8];
UsbHsInterface interfaces[16];
s32 total_entries;

if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_VENDOR_SPEC, 93, 1)))
Expand Down Expand Up @@ -293,7 +293,7 @@ Result mainLoop()
if (R_SUCCEEDED(rc))
{
WriteToLog("Dualshock 3 event went off");
UsbHsInterface interfaces[4];
UsbHsInterface interfaces[8];
s32 total_entries;

if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0)))
Expand All @@ -306,7 +306,7 @@ Result mainLoop()
if (R_SUCCEEDED(rc))
{
WriteToLog("Dualshock 4 event went off");
UsbHsInterface interfaces[4];
UsbHsInterface interfaces[8];
s32 total_entries;

if (R_SUCCEEDED(QueryInterfaces(interfaces, sizeof(interfaces), &total_entries, USB_CLASS_HID, 0, 0)))
Expand Down

0 comments on commit 3ff5734

Please sign in to comment.