diff --git a/README.md b/README.md index 6b210f3..f087570 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,18 @@ Currently working/fixed: - Gamepad mode - untested on EAC - default boot mode - Keyboard & Mouse Mode - limited to 6KRO - hold btn-a to enter kb mode -- HID LEDs with Reactive LED fallback - untested +- HID LEDs with Reactive LED fallback - sdvx/iidx spoof - untested on EAC - 1000hz polling -- Fix 0-~71% encoder rollover in gamepad mode, uint32 max val isn't divisible evenly by ppr\*4 for joystick - thanks friends - Switch and LED pins are now staggered for easier wiring +- Fix 0-~71% encoder rollover in gamepad mode, uint32 max val isn't divisible evenly by ppr\*4 for joystick - thanks friends TODO: - Store last mode in flash memory https://www.raspberrypi.org/forums/viewtopic.php?t=305570 - nkro - debounce +- ws2812b rgb on second core? - split input updating into pi pico's second core? How to Use: diff --git a/build_uf2/Pico_Game_Controller.uf2 b/build_uf2/Pico_Game_Controller.uf2 index 05ecc1a..7fee644 100644 Binary files a/build_uf2/Pico_Game_Controller.uf2 and b/build_uf2/Pico_Game_Controller.uf2 differ diff --git a/src/pico_game_controller.c b/src/pico_game_controller.c index a4be11a..38e5df8 100644 --- a/src/pico_game_controller.c +++ b/src/pico_game_controller.c @@ -24,7 +24,7 @@ #define ENC_PPR 600 // Encoder PPR #define ENC_PULSE (ENC_PPR * 4) // 4 pulses per PPR #define ENC_ROLLOVER (ENC_PULSE * 2) // Delta Rollover threshold -#define REACTIVE_TIMEOUT_MAX 1000 // Cycles before HID falls back to reactive +#define REACTIVE_TIMEOUT_MAX 100000 // Cycles before HID falls back to reactive // MODIFY KEYBINDS HERE, MAKE SURE LENGTHS MATCH SW_GPIO_SIZE const uint8_t SW_KEYCODE[] = {HID_KEY_D, HID_KEY_F, HID_KEY_J, HID_KEY_K, @@ -61,6 +61,9 @@ struct lights_report { * HID/Reactive Lights **/ void update_lights() { + if (reactive_timeout_count < REACTIVE_TIMEOUT_MAX) { + reactive_timeout_count++; + } if (leds_changed) { for (int i = 0; i < SW_GPIO_SIZE; i++) { if (reactive_timeout_count >= REACTIVE_TIMEOUT_MAX) {