Ver código fonte

fix bug with setup packet received (wrong increasement of pointer)

hathach 13 anos atrás
pai
commit
cae19b8f56
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      tinyusb/device/dcd_lpc175x_6x.c

+ 4 - 1
tinyusb/device/dcd_lpc175x_6x.c

@@ -120,8 +120,11 @@ void endpoint_control_isr(uint8_t coreid)
 
       uint32_t *p_setup = (uint32_t*) &usbd_devices[0].setup_packet;
       *p_setup = LPC_USB->USBRxData;
-      p_setup += 4;
+      p_setup++; // increase by 4 ( sizeof(uint32_t) )
       *p_setup = LPC_USB->USBRxData;
+
+      LPC_USB->USBCtrl = 0;
+
       // TODO setup received callback
       usbd_isr(0, TUSB_EVENT_SETUP_RECEIVED);
     }else