Add raw_hid support to host driver (#25255)
This commit is contained in:
parent
c045c3e00c
commit
88c094908b
12 changed files with 95 additions and 36 deletions
|
@ -144,7 +144,7 @@ static void send_report(uint8_t endpoint, void *report, size_t size) {
|
|||
static uint8_t raw_output_buffer[RAW_BUFFER_SIZE];
|
||||
static uint8_t raw_output_received_bytes = 0;
|
||||
|
||||
void raw_hid_send(uint8_t *data, uint8_t length) {
|
||||
static void send_raw_hid(uint8_t *data, uint8_t length) {
|
||||
if (length != RAW_BUFFER_SIZE) {
|
||||
return;
|
||||
}
|
||||
|
@ -152,12 +152,6 @@ void raw_hid_send(uint8_t *data, uint8_t length) {
|
|||
send_report(4, data, 32);
|
||||
}
|
||||
|
||||
__attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||
// Users should #include "raw_hid.h" in their own code
|
||||
// and implement this function there. Leave this as weak linkage
|
||||
// so users can opt to not handle data coming in.
|
||||
}
|
||||
|
||||
void raw_hid_task(void) {
|
||||
usbPoll();
|
||||
|
||||
|
@ -213,8 +207,20 @@ static void send_keyboard(report_keyboard_t *report);
|
|||
static void send_nkro(report_nkro_t *report);
|
||||
static void send_mouse(report_mouse_t *report);
|
||||
static void send_extra(report_extra_t *report);
|
||||
#ifdef RAW_ENABLE
|
||||
static void send_raw_hid(uint8_t *data, uint8_t length);
|
||||
#endif
|
||||
|
||||
static host_driver_t driver = {.keyboard_leds = usb_device_state_get_leds, .send_keyboard = send_keyboard, .send_nkro = send_nkro, .send_mouse = send_mouse, .send_extra = send_extra};
|
||||
static host_driver_t driver = {
|
||||
.keyboard_leds = usb_device_state_get_leds,
|
||||
.send_keyboard = send_keyboard,
|
||||
.send_nkro = send_nkro,
|
||||
.send_mouse = send_mouse,
|
||||
.send_extra = send_extra,
|
||||
#ifdef RAW_ENABLE
|
||||
.send_raw_hid = send_raw_hid,
|
||||
#endif
|
||||
};
|
||||
|
||||
host_driver_t *vusb_driver(void) {
|
||||
return &driver;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue