Line 217... |
Line 217... |
m_txbuf[4] = 0;
|
m_txbuf[4] = 0;
|
m_txbuf[5] = PUT_TDI_MASK | GET_TDO_MASK;
|
m_txbuf[5] = PUT_TDI_MASK | GET_TDO_MASK;
|
|
|
for(int i=0; i<len; i++)
|
for(int i=0; i<len; i++)
|
m_txbuf[6+i] = buf[i];
|
m_txbuf[6+i] = buf[i];
|
|
// printf("WRITE::(buf=%*s, %d)\n", len, buf, len);
|
r = libusb_bulk_transfer(m_xula_usb_device, XESS_ENDPOINT_OUT,
|
r = libusb_bulk_transfer(m_xula_usb_device, XESS_ENDPOINT_OUT,
|
(unsigned char*)m_txbuf, len+6, &actual_length, 0);
|
(unsigned char*)m_txbuf, len+6, &actual_length, 0);
|
if ((r!=0)||(actual_length != len+6)) {
|
if ((r!=0)||(actual_length != len+6)) {
|
printf("WRITE::(buf, %d) -- ERR\n", len+6);
|
printf("WRITE::(buf, %d) -- ERR\n", len+6);
|
printf("r = %d, actual_length = %d (!= %d requested)\n", r,
|
printf("r = %d, actual_length = %d (!= %d requested)\n", r,
|
Line 383... |
Line 384... |
printf("\tPopped %d items, buf[0] = %02x (%d - %d)\n",
|
printf("\tPopped %d items, buf[0] = %02x (%d - %d)\n",
|
nr, buf[0], m_rend, m_rbeg);
|
nr, buf[0], m_rend, m_rbeg);
|
else
|
else
|
printf("\tPopped nothing, %d - %d\n", m_rend, m_rbeg);
|
printf("\tPopped nothing, %d - %d\n", m_rend, m_rbeg);
|
*/
|
*/
|
|
|
return nr;
|
return nr;
|
}
|
}
|
|
|
bool USBI::poll(unsigned ms) {
|
bool USBI::poll(unsigned ms) {
|
int avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
|
int avail = (m_rbeg-m_rend)&(RCV_BUFMASK);
|