Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerialUSB.available() returns wrong value/only first byte #272

Closed
ghost opened this issue Nov 2, 2017 · 2 comments
Closed

SerialUSB.available() returns wrong value/only first byte #272

ghost opened this issue Nov 2, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 2, 2017

There is a problem with SerialUSB.available() if using Arduino Zero board.
I send 4 bytes, Terminal output switched from 0 to 4 (but sometimes it only shows 1). Now, if i send another 4 bytes, terminal output dont switch to 8. It still shows only 4.
It seems if available() method executed following received bytes are ignored.

Test sketch

void setup()
{
	SerialUSB.begin(115200);
	while(!SerialUSB);
}
void loop()
{
	int availableBytes = SerialUSB.available();
	SerialUSB.println(availableBytes, DEC);
	delay(1000);
}

Test procedure:

  • burn sketch
  • open terminal
  • terminal receive a 0 every second
  • send 4 bytes
  • now terminal receive a 1 or 4 every second
  • send another bytes
  • terminal should receive 8 but still get a 1 or 4 every second

*edit
If using Serial instead of SerialUSB the problem not occurs.

@ghost
Copy link

ghost commented Apr 23, 2019

Bug is still there

@facchinm
Copy link
Member

Fixed by c8094e7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants