コード例 #1
0
ファイル: usb_serial.c プロジェクト: Rockbox/rockbox
static void sendout(void)
{
    buffer_transitlength = MIN(buffer_length,BUFFER_SIZE-buffer_start);
    if(buffer_transitlength > 0)
    {
        buffer_transitlength = MIN(buffer_transitlength,TRANSIT_BUFFER_SIZE);
        buffer_length -= buffer_transitlength;
        memcpy(transit_buffer,&send_buffer[buffer_start],buffer_transitlength);
        usb_drv_send_nonblocking(ep_in,transit_buffer,buffer_transitlength);
    }
}
コード例 #2
0
ファイル: usb_serial.c プロジェクト: BurntBrunch/rockbox-fft
static void sendout(void)
{
    buffer_transitlength = MIN(buffer_length,BUFFER_SIZE-buffer_start);
    /* For unknown reasons packets larger than 96 bytes are not sent. We play
     * safe and limit to 32. TODO: find the real bug */
    buffer_transitlength = MIN(buffer_transitlength,32);
    if(buffer_transitlength > 0)
    {
        buffer_length -= buffer_transitlength;
        usb_drv_send_nonblocking(ep_in, &send_buffer[buffer_start],
                buffer_transitlength);
    }
}