Merge pull request #29 from speedypotato/feature/qol_rgb_mouse

Disable RGB on start hold, added mouse sens multiplier
This commit is contained in:
Nick G
2022-01-06 11:29:36 -05:00
committed by GitHub
3 changed files with 17 additions and 12 deletions
Binary file not shown.
+1
View File
@@ -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
+16 -12
View File
@@ -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();