Просмотр исходного кода

revert wake changes because of regression

Jariullah Safi 4 месяцев назад
Родитель
Сommit
2a8f8dd1a1
1 измененных файлов с 2 добавлено и 10 удалено
  1. 2 10
      OpenPuck/puck_hid.cpp

+ 2 - 10
OpenPuck/puck_hid.cpp

@@ -39,9 +39,7 @@ static const uint8_t PUCK_HID_DESC[] = {
   0x3F,0x09,0x87,0x91,0x02,0x85,0x89,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,
   0x3F,0x09,0x87,0x91,0x02,0x85,0x89,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,
   0x09,0x89,0x91,0x02,0x85,0x88,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,0x09,
   0x09,0x89,0x91,0x02,0x85,0x88,0x15,0x00,0x26,0xFF,0x00,0x75,0x08,0x95,0x3F,0x09,
   0x88,0x91,0x02,0x85,0x01,0x95,0x3F,0x09,0x01,0xB1,0x02,0x85,0x02,0x95,0x3F,0x09,
   0x88,0x91,0x02,0x85,0x01,0x95,0x3F,0x09,0x01,0xB1,0x02,0x85,0x02,0x95,0x3F,0x09,
-  0x01,0xB1,0x02,0xC0,
-  0x05,0x0C,0x09,0x01,0xA1,0x01,0x85,0x03,0x15,0x00,0x25,0x01,0x09,0xE9,0x09,0xEA,
-  0x75,0x01,0x95,0x02,0x81,0x02,0x75,0x06,0x95,0x01,0x81,0x01,0xC0
+  0x01,0xB1,0x02,0xC0
 };
 };
 
 
 static Adafruit_USBD_HID hid[NSLOT];
 static Adafruit_USBD_HID hid[NSLOT];
@@ -270,14 +268,8 @@ static void wakeNudgeTask(){
 // connected. Without it Steam shows disconnected even though 0x45 input is streaming.
 // connected. Without it Steam shows disconnected even though 0x45 input is streaming.
 void SteamPuckController::task(){
 void SteamPuckController::task(){
   wakeNudgeTask();
   wakeNudgeTask();
-  { static bool wasSusp=false; bool susp=USBDevice.suspended();
+  { static bool wasSusp=false; bool susp=USBDevice.suspended();   // stamp the suspended->active edge for the post-resume mute
     if(wasSusp && !susp) g_resumeMs=millis();
     if(wasSusp && !susp) g_resumeMs=millis();
-    // Delayed shutdown on host sleep: arm 3s timer on suspend edge, cancel on resume. Prevents transient
-    // suspend/resume cycles during system wake from killing the controller.
-    static unsigned long shutAt=0;
-    if(susp && !wasSusp) shutAt=millis()+3000u;
-    if(!susp && wasSusp) shutAt=0;
-    if(susp && shutAt && (int32_t)(millis()-shutAt)>=0){ shutAt=0; hapticSendShutdown(); }
     wasSusp=susp; }
     wasSusp=susp; }
   if (USBDevice.suspended()) return;   // no periodic 0x79/0x7B while the host sleeps -- those sends can wake it too
   if (USBDevice.suspended()) return;   // no periodic 0x79/0x7B while the host sleeps -- those sends can wake it too
   static bool usbConn=false; static unsigned long last79=0, last7B=0, connEdgeMs=0;
   static bool usbConn=false; static unsigned long last79=0, last7B=0, connEdgeMs=0;