How to use 2 HIDs with 1 STM32?
Hello !
I am trying to make 1 STM32 that handles 2 HIDs, one keyboard (HID_MOUSE_ReportDescK[HID_MOUSE_REPORT_DESC_SIZEK]), one mouse (HID_MOUSE_ReportDesc[HID_MOUSE_REPORT_DESC_SIZE]).
I use a STM32F103C8T6.
I tried to create 2 int (used as boolean) that permit to know if it has to be a keyboard or a mouse.
Those int are also used like that:
#if mouseEnabled == 1
HID_MOUSE_REPORT_DESC_SIZE
#elif keyboardEnabled == 1
HID_MOUSE_REPORT_DESC_SIZEK,
#endif if (req->wValue >> 8 == HID_REPORT_DESC && mouseEnabled == 1)
{
len = MIN(HID_MOUSE_REPORT_DESC_SIZE, req->wLength);
pbuf = HID_MOUSE_ReportDesc;
}
else if (req->wValue >> 8 == HID_REPORT_DESC && keyboardEnabled == 1)
{
len = MIN(HID_MOUSE_REPORT_DESC_SIZEK, req->wLength);
pbuf = HID_MOUSE_ReportDescK;
}But, I am a beginner in the MCUs / programming world it's why I figured lately that what I made, works only when I change the int before debugging. I also tried many other things that came to fail.
Thank you for your help.
