File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
system/libmaple/usb/usb_lib Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ uint32 usb_cdcacm_rx(uint8* buf, uint32 len) {
451451
452452 /* If all bytes have been read, re-enable the RX endpoint, which
453453 * was set to NAK when the current batch of bytes was received. */
454- if (n_unread_bytes <= ( CDC_SERIAL_BUFFER_SIZE - USB_CDCACM_RX_EPSIZE ) ) {
454+ if (n_unread_bytes == 0 ) {
455455 usb_set_ep_rx_count (USB_CDCACM_RX_ENDP , USB_CDCACM_RX_EPSIZE );
456456 usb_set_ep_rx_stat (USB_CDCACM_RX_ENDP , USB_EP_STAT_RX_VALID );
457457 }
@@ -567,7 +567,7 @@ static void vcomDataRxCb(void) {
567567
568568 n_unread_bytes += ep_rx_size ;
569569
570- if (n_unread_bytes <= ( CDC_SERIAL_BUFFER_SIZE - USB_CDCACM_RX_EPSIZE ) ) {
570+ if (n_unread_bytes == 0 ) {
571571 usb_set_ep_rx_count (USB_CDCACM_RX_ENDP , USB_CDCACM_RX_EPSIZE );
572572 usb_set_ep_rx_stat (USB_CDCACM_RX_ENDP , USB_EP_STAT_RX_VALID );
573573 }
Original file line number Diff line number Diff line change 3131#define USB_StatusIn () Send0LengthData()
3232#define USB_StatusOut () vSetEPRxStatus(EP_RX_VALID)
3333
34- #define StatusInfo0 StatusInfo.bw.bb1 /* Reverse bb0 & bb1 */
35- #define StatusInfo1 StatusInfo.bw.bb0
36-
3734/* Private macro -------------------------------------------------------------*/
3835/* Private variables ---------------------------------------------------------*/
3936u16_u8 StatusInfo ;
@@ -857,11 +854,11 @@ u8 Setup0_Process(void)
857854 pInformation -> USBbmRequestType = * pBuf .b ++ ; /* bmRequestType */
858855 pInformation -> USBbRequest = * pBuf .b ++ ; /* bRequest */
859856 pBuf .w ++ ; /* word not accessed because of 32 bits addressing */
860- pInformation -> USBwValue = ByteSwap ( * pBuf .w ++ ) ; /* wValue */
857+ pInformation -> USBwValue = * pBuf .w ++ ; /* wValue in Little Endian */
861858 pBuf .w ++ ; /* word not accessed because of 32 bits addressing */
862- pInformation -> USBwIndex = ByteSwap ( * pBuf .w ++ ) ; /* wIndex */
859+ pInformation -> USBwIndex = * pBuf .w ++ ; /* wIndex in Little Endian */
863860 pBuf .w ++ ; /* word not accessed because of 32 bits addressing */
864- pInformation -> USBwLength = * pBuf .w ; /* wLength */
861+ pInformation -> USBwLength = * pBuf .w ; /* wLength in Little Endian */
865862 }
866863
867864 pInformation -> ControlState = SETTING_UP ;
Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ typedef union
101101 u16 w ;
102102 struct BW
103103 {
104- u8 bb1 ;
104+ /* Little Endian */
105105 u8 bb0 ;
106+ u8 bb1 ;
106107 }
107108 bw ;
108109} u16_u8 ;
@@ -211,6 +212,8 @@ USER_STANDARD_REQUESTS;
211212#define USBwLength USBwLengths.w
212213#define USBwLength0 USBwLengths.bw.bb0
213214#define USBwLength1 USBwLengths.bw.bb1
215+ #define StatusInfo0 StatusInfo.bw.bb0
216+ #define StatusInfo1 StatusInfo.bw.bb1
214217
215218/* Exported macro ------------------------------------------------------------*/
216219/* Exported functions ------------------------------------------------------- */
You can’t perform that action at this time.
0 commit comments