Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

CDC boolean operator speed issue #106

Copy link
Copy link
Open
@DesperateProgrammer

Description

@DesperateProgrammer
Issue body actions

While looking for a slow USB CDC connection (~30-40kB/s) I found that there is an artifical delay in the boolean operator:

I can not find a reasoning for this delay. Removing it from the source greatly improved USB Speed for me to about 140kB/s

void setup() {
  // put your setup code here, to run once:
  SerialUSB.begin(2000000) ;
}

byte buffer[512] ;

void loop() {

#if 1
  int pos = 0 ;
  if (!SerialUSB)
    return ;
  while (SerialUSB.available())
  {
    if (pos >= sizeof(buffer))
      return ;
    buffer[pos++] = SerialUSB.read();
  }
  if (pos)
    SerialUSB.write(buffer, pos);
  return ;
#endif
}

Does anyone know the reasoning behind this delay?

Thanks in advance,
Tim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.