suppress hid events from host when device is disconnected

This commit is contained in:
2026-05-08 11:40:49 -04:00
parent 9762476e4b
commit 75d8f87b40
2 changed files with 17 additions and 11 deletions
+7 -3
View File
@@ -360,11 +360,15 @@ void startADC() {
// forward HID report after processing
bool forward_report(uint8_t instance, uint8_t const* report, uint16_t len) {
if (instance == 0x01 && report[0] == 0x03 && report[1] == 0xE2) {
mute = !mute;
if (device_state == DEVICE_ACTIVE ) {
if (instance == 0x01 && report[0] == 0x03 && report[1] == 0xE2) {
mute = !mute;
}
return tud_hid_n_report(instance, 0, report, len);
}
return tud_hid_n_report(instance, 0, report, len);
return true;
}
// save RGB configuration to flash