diff --git a/build_uf2/Pico_Game_Controller.uf2 b/build_uf2/Pico_Game_Controller.uf2 index cfd24d2..c97b943 100644 Binary files a/build_uf2/Pico_Game_Controller.uf2 and b/build_uf2/Pico_Game_Controller.uf2 differ diff --git a/src/controller_config.h b/src/controller_config.h index d948388..03f5e23 100644 --- a/src/controller_config.h +++ b/src/controller_config.h @@ -5,6 +5,7 @@ #define LED_GPIO_SIZE 10 // Number of switch LEDs #define ENC_GPIO_SIZE 2 // Number of encoders #define ENC_PPR 600 // Encoder PPR +#define MOUSE_SENS 1 // Mouse sensitivity multiplier #define ENC_DEBOUNCE true // Encoder Debouncing #define SW_DEBOUNCE_TIME_US 4000 // Switch debounce delay in us #define ENC_PULSE (ENC_PPR * 4) // 4 pulses per PPR diff --git a/src/pico_game_controller.c b/src/pico_game_controller.c index db2cf5a..84d9b32 100644 --- a/src/pico_game_controller.c +++ b/src/pico_game_controller.c @@ -201,7 +201,8 @@ void key_mode() { tud_hid_n_report(0x00, REPORT_ID_KEYBOARD, &nkro_report, sizeof(nkro_report)); } else { - tud_hid_mouse_report(REPORT_ID_MOUSE, 0x00, delta[0], delta[1], 0, 0); + tud_hid_mouse_report(REPORT_ID_MOUSE, 0x00, delta[0] * MOUSE_SENS, + delta[1] * MOUSE_SENS, 0, 0); } // Alternate reports kbm_report = !kbm_report; @@ -239,6 +240,17 @@ void dma_handler() { } } +/** + * Second Core Runnable + **/ +void core1_entry() { + uint32_t counter = 0; + while (1) { + ws2812b_update(++counter); + sleep_ms(5); + } +} + /** * Initialize Board Pins **/ @@ -308,16 +320,10 @@ void init() { loop_mode = &joy_mode; joy_mode_check = true; } -} -/** - * Second Core Runnable - **/ -void core1_entry() { - uint32_t counter = 0; - while (1) { - ws2812b_update(++counter); - sleep_ms(5); + // Disable RGB + if (gpio_get(SW_GPIO[8])) { + multicore_launch_core1(core1_entry); } } @@ -329,8 +335,6 @@ int main(void) { init(); tusb_init(); - multicore_launch_core1(core1_entry); - while (1) { tud_task(); // tinyusb device task update_inputs();