feat(hid): 实现HID通道状态管理和多通道支持

- 将原来的HID传输状态事件替换为新的HID通道状态事件,支持USB键盘、USB消费者和BLE共享通道
- 添加usb_hid_consumer_module.c模块来处理USB消费者HID报告
- 添加usb_hid_keyboard_module.c模块来处理USB键盘HID报告
- 修改CMakeLists.txt以包含新的HID模块源文件
- 更新事件系统中的transport字段为channel字段,并相应修改所有相关处理逻辑
- 在hid_flowctrl_module.c中实现多通道并发处理机制
- 删除过时的hid_transport_state_event相关代码
- 添加新的hid_channel_state_event用于报告各通道就绪状态
This commit is contained in:
2026-04-15 15:47:14 +08:00
parent 6125f04102
commit bd57b00080
16 changed files with 979 additions and 882 deletions

View File

@@ -43,7 +43,6 @@ static struct k_work_delayable rx_flush_work;
static bool initialized;
static bool running;
static bool usb_active;
static bool usb_function_prepared;
static bool dtr_ready;
static bool rx_enabled;
static uint8_t proto_rx_buf[USB_CDC_PROTO_RX_BUF_SIZE];
@@ -275,7 +274,6 @@ static int module_init(void)
k_work_init_delayable(&control_work, control_work_handler);
k_work_init_delayable(&rx_flush_work, rx_flush_work_handler);
uart_irq_callback_set(cdc_dev, cdc_interrupt_handler);
usb_function_prepared = false;
proto_rx_len = 0U;
return 0;
}