1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00
RetroArch/wiiu/include
gblues 560a5f0a4f Fix the blocking call to HIDRead()
== DETAILS

TIL that the "max_packet_size_*" fields in the HIDDevice struct
are actually requirements, not maximums.

The reason HIDRead() was blocking was because the HIDWrite() that
sent the activation command was silently failing.

The reason HIDWrite() was silently failing was because I was using too
small of a buffer for the device.

In this case: the Wii U GC adapter, which has a "max" tx packet size of 5.

"max" is misleading. You actually have to write all 5 bytes.

Which means: copying the 1-byte buffer to the 5-byte buffer, and writing
the 5-byte buffer via HIDWrite().

So, in summary:

- Use correct semantics for HIDWrite() so that HIDRead() can work.
- Update the OSThread struct to reflect the current knowledge over at
  WUT. It's unlikely this was actually causing a problem, but never
  hurts to be more correct.

== TESTING
I temporarily enabled the call to log_buffer() and confirmed that the
GC adapter's state is successfully being read.
2018-01-05 23:12:42 -08:00
..
arpa (WiiU) enable networking. 2017-05-23 10:24:23 +01:00
netinet (WiiU) fix netplay. 2017-05-26 12:32:45 +01:00
sys (WiiU) fix netplay. 2017-05-26 12:32:45 +01:00
wiiu Fix the blocking call to HIDRead() 2018-01-05 23:12:42 -08:00
netdb.h (WiiU) enable networking. 2017-05-23 10:24:23 +01:00