shithub: m8c

Download patch

ref: 9632f3cbbde78f288e80d3e536716f529d2ba29e
parent: a01e21d39cc15fc670d8b5d982bd85eaffccbc0f
author: smootalicious <smootalicious@gmail.com>
date: Thu Jun 16 08:09:01 EDT 2022

Set the zero packet wait back down to ~2 seconds, but added a check to not start device disconnect detection while user is pressing buttons. This allows the user to stay on the Effect Help screen indefinitely, since thay have the 'EDIT' button pressed the whole time. If unit is disconnected, m8c shutsdown after ~2 seconds.

--- a/config.c
+++ b/config.c
@@ -26,7 +26,7 @@
   c.init_use_gpu = 1;    // default to use hardware acceleration
   c.idle_ms = 10;        // default to high performance
   c.wait_for_device = 0; // default to exit if device disconnected
-  c.wait_packets = 1500;   // default zero-byte attempts to disconnect (about 15 sec for default idle_ms)
+  c.wait_packets = 128;   // default zero-byte attempts to disconnect (about 2 sec for default idle_ms)
 
   c.key_up = SDL_SCANCODE_UP;
   c.key_left = SDL_SCANCODE_LEFT;
--- a/main.c
+++ b/main.c
@@ -165,6 +165,7 @@
       // get current inputs
       input_msg_s input = get_input_msg(&conf);
 
+      if (input.value != 0) zerobyte_packets = 0; // don't try to detect disconnect until user stops pressing buttons 
       switch (input.type) {
       case normal:
         if (input.value != prev_input) {
--