dcd_msp430x5xx: Implement transmit_packet for nonzero endpoints. Untested.
This commit is contained in:
parent
2247f132ca
commit
838b431fac
|
@ -382,8 +382,6 @@ static void transmit_packet(uint8_t ep_num)
|
||||||
{
|
{
|
||||||
xfer_ctl_t * xfer = XFER_CTL_BASE(ep_num, TUSB_DIR_IN);
|
xfer_ctl_t * xfer = XFER_CTL_BASE(ep_num, TUSB_DIR_IN);
|
||||||
|
|
||||||
if(ep_num == 0)
|
|
||||||
{
|
|
||||||
// First, determine whether we should even send a packet or finish
|
// First, determine whether we should even send a packet or finish
|
||||||
// up the xfer.
|
// up the xfer.
|
||||||
bool zlp = (xfer->total_len == 0); // By necessity, xfer->total_len will
|
bool zlp = (xfer->total_len == 0); // By necessity, xfer->total_len will
|
||||||
|
@ -407,6 +405,8 @@ static void transmit_packet(uint8_t ep_num)
|
||||||
xfer->short_packet = true;
|
xfer->short_packet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ep_num == 0)
|
||||||
|
{
|
||||||
volatile uint8_t * ep0in_buf = &USBIEP0BUF;
|
volatile uint8_t * ep0in_buf = &USBIEP0BUF;
|
||||||
for(int i = 0; i < xfer_size; i++)
|
for(int i = 0; i < xfer_size; i++)
|
||||||
{
|
{
|
||||||
|
@ -416,6 +416,20 @@ static void transmit_packet(uint8_t ep_num)
|
||||||
USBIEPCNT_0 = (USBIEPCNT_0 & 0xF0) + xfer_size;
|
USBIEPCNT_0 = (USBIEPCNT_0 & 0xF0) + xfer_size;
|
||||||
USBIEPCNT_0 &= ~NAK;
|
USBIEPCNT_0 &= ~NAK;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ep_regs_t ep_regs = EP_REGS(ep_num, TUSB_DIR_IN);
|
||||||
|
uint16_t in_buf_base = USBSTABUFF + (ep_regs[BBAX] << 3);
|
||||||
|
|
||||||
|
volatile uint8_t * ep_buf = (volatile uint8_t *) (in_buf_base);
|
||||||
|
for(int i = 0; i < xfer_size; i++)
|
||||||
|
{
|
||||||
|
ep_buf[i] = base[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
ep_regs[BCTX] = (ep_regs[BCTX] & 0xF0) + xfer_size;
|
||||||
|
ep_regs[BCTX] &= ~NAK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_setup_packet(void)
|
static void handle_setup_packet(void)
|
||||||
|
|
Loading…
Reference in New Issue