Removed checks not needed for the Wii U Pro Controller
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c
index 0b9922f..0e4ac48 100644
--- a/src/joystick/hidapi/SDL_hidapi_wii.c
+++ b/src/joystick/hidapi/SDL_hidapi_wii.c
@@ -38,7 +38,6 @@
/* Define this if you want to log all packets from the controller */
/*#define DEBUG_WII_PROTOCOL*/
-//#define DEBUG_WII_PROTOCOL
#define INPUT_WAIT_TIMEOUT_MS (3 * 1000)
#define MOTION_PLUS_UPDATE_TIME_MS (8 * 1000)
@@ -1530,27 +1529,31 @@ HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
size = -1;
}
- /* Check to see if the Motion Plus extension status has changed */
- if (ctx->m_unNextMotionPlusCheck &&
- SDL_TICKS_PASSED(now, ctx->m_unNextMotionPlusCheck)) {
- CheckMotionPlusConnection(ctx);
- if (NeedsPeriodicMotionPlusCheck(ctx, SDL_FALSE)) {
- SchedulePeriodicMotionPlusCheck(ctx);
- } else {
- ctx->m_unNextMotionPlusCheck = 0;
+ /* These checks aren't needed on the Wii U Pro Controller */
+ if (ctx->m_eExtensionControllerType != k_eWiiExtensionControllerType_WiiUPro) {
+
+ /* Check to see if the Motion Plus extension status has changed */
+ if (ctx->m_unNextMotionPlusCheck &&
+ SDL_TICKS_PASSED(now, ctx->m_unNextMotionPlusCheck)) {
+ CheckMotionPlusConnection(ctx);
+ if (NeedsPeriodicMotionPlusCheck(ctx, SDL_FALSE)) {
+ SchedulePeriodicMotionPlusCheck(ctx);
+ } else {
+ ctx->m_unNextMotionPlusCheck = 0;
+ }
}
- }
- /* Request a status update periodically to make sure our battery value is up to date */
- if (!ctx->m_unLastStatus ||
- SDL_TICKS_PASSED(now, ctx->m_unLastStatus + STATUS_UPDATE_TIME_MS)) {
- Uint8 data[2];
+ /* Request a status update periodically to make sure our battery value is up to date */
+ if (!ctx->m_unLastStatus ||
+ SDL_TICKS_PASSED(now, ctx->m_unLastStatus + STATUS_UPDATE_TIME_MS)) {
+ Uint8 data[2];
- data[0] = k_eWiiOutputReportIDs_StatusRequest;
- data[1] = ctx->m_bRumbleActive;
- WriteOutput(ctx, data, sizeof(data), SDL_FALSE);
+ data[0] = k_eWiiOutputReportIDs_StatusRequest;
+ data[1] = ctx->m_bRumbleActive;
+ WriteOutput(ctx, data, sizeof(data), SDL_FALSE);
- ctx->m_unLastStatus = now;
+ ctx->m_unLastStatus = now;
+ }
}
if (size < 0 || ctx->m_bDisconnected) {