Skip to content

Commit 4f753fc

Browse files
Merge branch 'jaretburkett-master'
2 parents c6c8827 + f9301a6 commit 4f753fc

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

STM32F1/cores/maple/libmaple/usb/stm32f1/usb_cdcacm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

STM32F1/cores/maple/libmaple/usb/usb_lib/usb_core.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
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 ---------------------------------------------------------*/
3936
u16_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;

STM32F1/system/libmaple/usb/usb_lib/usb_core.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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 ------------------------------------------------------- */

0 commit comments

Comments
 (0)