From: arighi Date: Thu, 23 Sep 2010 10:24:21 +0000 (+0000) Subject: STM32: USB: device, interface and endpoint status is always uint16_t X-Git-Tag: 2.6.0~133 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=854199db6c8a6aee9b131095a8c3d7934ebcc1ae;p=bertos.git STM32: USB: device, interface and endpoint status is always uint16_t git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4268 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/cpu/cortex-m3/drv/usb_stm32.c b/bertos/cpu/cortex-m3/drv/usb_stm32.c index e625cdfa..f2135493 100644 --- a/bertos/cpu/cortex-m3/drv/usb_stm32.c +++ b/bertos/cpu/cortex-m3/drv/usb_stm32.c @@ -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; }