Explorar o código

Wii: re-request the status if we get a communication error

Sam Lantinga %!s(int64=3) %!d(string=hai) anos
pai
achega
c3ecb9d099
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/joystick/hidapi/SDL_hidapi_wii.c

+ 3 - 1
src/joystick/hidapi/SDL_hidapi_wii.c

@@ -1163,7 +1163,9 @@ HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
     }
     }
 
 
     /* Request a status update periodically to make sure our battery value is up to date */
     /* 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 + FIFTEEN_MINUTES_IN_MS)) {
+    if (!ctx->m_unLastStatus ||
+        SDL_TICKS_PASSED(now, ctx->m_unLastStatus + FIFTEEN_MINUTES_IN_MS) ||
+        ctx->m_eCommState == k_eWiiCommunicationState_Error) {
         Uint8 data[2];
         Uint8 data[2];
 
 
         data[0] = k_eWiiOutputReportIDs_StatusRequest;
         data[0] = k_eWiiOutputReportIDs_StatusRequest;