Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t reportBuffer[4] = {0};
- uint8_t asyncReport = 0;
- void MainLoop_Tick(){
- if(asyncReport != 0){
- if(asyncReport == STATUS_REPORT_ID){
- //DO SENSOR STUFF
- reportBuffer[0] = STATUS_REPORT_ID;
- USBD_CtlSendData (&USB_DEVICE, reportBuffer, 4);
- }
- }
- }
- void USBD_HID_ProcessGetFeatureEvent(uint8_t report_id){
- switch(report_id){
- case STATUS_REPORT_ID:
- asyncReport = STATUS_REPORT_ID;
- break;
- default:
- reportBuffer[0] = report_id;
- USBD_CtlSendData (&USB_DEVICE, reportBuffer, 4);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement