mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
Merge pull request #1160 from cr1901/msp-fix
msp430x5xx: Set base of transmit_packet buffer earlier to avoid incre…
This commit is contained in:
commit
55e0b5882a
@ -547,6 +547,7 @@ static void transmit_packet(uint8_t ep_num)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Then actually commit to transmit a packet.
|
// Then actually commit to transmit a packet.
|
||||||
|
uint8_t * base = (xfer->buffer + xfer->queued_len);
|
||||||
uint16_t remaining = xfer->total_len - xfer->queued_len;
|
uint16_t remaining = xfer->total_len - xfer->queued_len;
|
||||||
uint8_t xfer_size = (xfer->max_size < xfer->total_len) ? xfer->max_size : remaining;
|
uint8_t xfer_size = (xfer->max_size < xfer->total_len) ? xfer->max_size : remaining;
|
||||||
|
|
||||||
@ -560,7 +561,6 @@ static void transmit_packet(uint8_t ep_num)
|
|||||||
if(ep_num == 0)
|
if(ep_num == 0)
|
||||||
{
|
{
|
||||||
volatile uint8_t * ep0in_buf = &USBIEP0BUF;
|
volatile uint8_t * ep0in_buf = &USBIEP0BUF;
|
||||||
uint8_t * base = (xfer->buffer + xfer->queued_len);
|
|
||||||
for(uint16_t i = 0; i < xfer_size; i++)
|
for(uint16_t i = 0; i < xfer_size; i++)
|
||||||
{
|
{
|
||||||
ep0in_buf[i] = base[i];
|
ep0in_buf[i] = base[i];
|
||||||
@ -582,7 +582,6 @@ static void transmit_packet(uint8_t ep_num)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
uint8_t * base = (xfer->buffer + xfer->queued_len);
|
|
||||||
for(int i = 0; i < xfer_size; i++)
|
for(int i = 0; i < xfer_size; i++)
|
||||||
{
|
{
|
||||||
ep_buf[i] = base[i];
|
ep_buf[i] = base[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user