OpenCores
URL https://opencores.org/ocsvn/xulalx25soc/xulalx25soc/trunk

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [sw/] [usbi.cpp] - Diff between revs 11 and 13

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 11 Rev 13
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);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.