code cleanup

This commit is contained in:
2025-08-23 21:13:11 -04:00
parent a74808f026
commit ffeb74686c
5 changed files with 10 additions and 20 deletions
+2 -2
View File
@@ -16,7 +16,6 @@ host_state_t host_state;
struct report_desc *descriptors;
uint8_t num_mounted=0;
static absolute_time_t request_time;
static struct report_data *report;
static bool enabled=false;
static uint8_t kb_addr=0;
@@ -91,7 +90,7 @@ void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_re
cdc_count = sprintf(cdc_buf, "Mount: [%04x:%04x][%u:%u] Protocol = %u\n", vid, pid, dev_addr, instance, itf_protocol);
tud_cdc_write(cdc_buf, cdc_count);
// enable RGB control if HyperX Elite 2 is mounted
if (vid==HYPERX_KEYBOARD_VID && pid==HYPERX_ELITE2_PID) {
kb_addr = dev_addr;
enabled = true;
@@ -119,6 +118,7 @@ void tuh_hid_umount_cb(uint8_t dev_addr, uint8_t instance)
remove_instance(dev_addr, instance);
if (dev_addr == kb_addr) {
enabled = false;
kb_addr=0;
}
num_mounted--;
host_state=HOST_UNMOUNTED;