2020-05-13 02:12 PM
I am trying to send a shift + U keypress to the screen every two seconds but it is just printing U's nonstop. Why isn't it delaying for two seconds? How do I properly debug stuff like this in the future?
while (1)
{
hid_report_buffer[0] = 0x02; //0b00000010;
hid_report_buffer[2] = 0x18;
USBD_HID_SendReport(&hUsbDeviceFS, hid_report_buffer, 8);
hid_report_buffer[0] = 0x00; //0b00000000;
hid_report_buffer[2] = 0x00;
USBD_HID_SendReport(&hUsbDeviceFS, hid_report_buffer, 8);
HAL_Delay(2000);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
2020-05-13 02:18 PM
Because the "release" code probably does not get on the wire. Can you see why?
-- pa
2020-05-13 04:13 PM
I think it is because of the polling interval on the host. It works when I insert a delay larger than the polling interval. But I am still confused as why the delay is not being hit at all in the first case.