STM32: USB: device, interface and endpoint status is always uint16_t
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 23 Sep 2010 10:24:21 +0000 (10:24 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 23 Sep 2010 10:24:21 +0000 (10:24 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4268 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/usb_stm32.c

index e625cdfab7712314d61aee334858af4dc65d16ec..f2135493db52cee901c0bebd1e6d1b05ed13c5ec 100644 (file)
@@ -1178,46 +1178,37 @@ static uint32_t InData;
 /* Get device status */
 static int UsbDevStatus(uint16_t index)
 {
-       size_t size;
-
        if (index)
                return -USB_NODEV_ERROR;
 
        InData = ((uint32_t)udc.feature) & 0xff;
-       size = usb_size(sizeof(InData), usb_le16_to_cpu(setup_packet.wLength));
        __usb_ep_write(CTRL_ENP_IN,
-                       (uint8_t *)&InData, size, USB_StatusHandler);
-
+                       (uint8_t *)&InData, sizeof(uint16_t),
+                       USB_StatusHandler);
        return 0;
 }
 
 /* Get interface status */
 static int UsbInterfaceStatus(UNUSED_ARG(uint16_t, index))
 {
-       size_t size;
-
        InData = 0;
-       size = usb_size(sizeof(InData), usb_le16_to_cpu(setup_packet.wLength));
        __usb_ep_write(CTRL_ENP_IN,
-                       (uint8_t *)&InData, size, USB_StatusHandler);
-
+                       (uint8_t *)&InData, sizeof(uint16_t),
+                       USB_StatusHandler);
        return 0;
 }
 
 /* Get endpoint status */
 static int UsbEpStatus(uint16_t index)
 {
-       size_t size;
-
        if ((index & 0x7F) > 16)
                return -USB_NODEV_ERROR;
 
        InData = 0;
        USB_GetStallEP(USB_EpLogToPhysAdd(index), (bool *)&InData);
-       size = usb_size(sizeof(InData), usb_le16_to_cpu(setup_packet.wLength));
        __usb_ep_write(CTRL_ENP_IN,
-                       (uint8_t *)&InData, size, USB_StatusHandler);
-
+                       (uint8_t *)&InData, sizeof(uint16_t),
+                       USB_StatusHandler);
        return 0;
 }