Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. uint8_t reportBuffer[4] = {0};
  2. uint8_t asyncReport = 0;
  3.  
  4. void MainLoop_Tick(){
  5.     if(asyncReport != 0){
  6.         if(asyncReport == STATUS_REPORT_ID){
  7.             //DO SENSOR STUFF
  8.             reportBuffer[0] = STATUS_REPORT_ID;
  9.             USBD_CtlSendData (&USB_DEVICE, reportBuffer, 4);
  10.         }
  11.     }
  12. }
  13.  
  14. void USBD_HID_ProcessGetFeatureEvent(uint8_t report_id){
  15.     switch(report_id){
  16.         case STATUS_REPORT_ID:
  17.             asyncReport = STATUS_REPORT_ID;
  18.             break;
  19.         default:
  20.             reportBuffer[0] = report_id;
  21.             USBD_CtlSendData (&USB_DEVICE, reportBuffer, 4);
  22.             break;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement