Selaa lähdekoodia

stability test: signal host-awake (E7) instead of relying on buzz

Puck->controller haptics don't keep a controller awake -- its auto-off is
driven by its own user-input inactivity (we already poll every 4ms without
preventing sleep). The E7 poll carries a host-awake/suspended flag
(0xE7 00 00 = awake per the RE); OpenPuck defaults to bare-E3 and never
sends it. The stability test (cmd 0x0F) now enables the E7 host-awake
announce (g_e7announce, g_e7b=0) while active, so the controller is told the
host is awake. The 10s buzz stays -- it exercises the haptic-relay path that
correlates with the hang.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jari 3 kuukautta sitten
vanhempi
commit
b7f68a6a06
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 7 2
      OpenPuck/webusb_config.cpp

+ 7 - 2
OpenPuck/webusb_config.cpp

@@ -363,10 +363,15 @@ void webusbPoll()
 			else if (op == 0x09) {
 			else if (op == 0x09) {
 				g_bondExportRequest = true;
 				g_bondExportRequest = true;
 			}
 			}
-			// 0x0F: stability test on/off -- when on, the puck buzzes all controllers every 10s to keep them
-			// awake so an unattended uptime-until-hang measurement isn't ended by a controller idle-sleeping.
+			// 0x0F: stability test on/off. Puck->controller haptics do NOT reset the controller's own
+			// user-input idle auto-off (we already poll it every 4ms without keeping it awake), so instead
+			// signal host-awake: enable the E7 announce (0xE7 00 00 = host-awake vs 00 01 = suspended, per
+			// the RE) so the controller is told the host is active and (hopefully) doesn't power-save. The
+			// 10s buzz stays -- it also exercises the haptic-relay path that correlates with the hang.
 			else if (op == 0x0F) {
 			else if (op == 0x0F) {
 				g_stabTest = (buf[1] != 0);
 				g_stabTest = (buf[1] != 0);
+				g_e7b = 0; // byte2=0 => host-awake
+				g_e7announce = g_stabTest;
 			}
 			}
 #if OPK_LOG
 #if OPK_LOG