Skip to content

A fix for issue 672: http://code.google.com/p/arduino/issues/detail?id=672 #43

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

Closed
wants to merge 3 commits into from

Conversation

hjohnson
Copy link

@hjohnson hjohnson commented Oct 9, 2011

I discovered this potential issue earlier today, see the above link for more information. To fix this, I added a function called waitForBufferSpace(uint8_t) so the user can decide whether HardwareSerial should wait for buffer space when Serial.write() is called. By default, nothing has changed, and no serial data is lost. However, by calling Serial.waitForBufferSpace(0), the user can disable this waiting. This means that there is the potential for serial data that was supposed to be printed to be lost, but on the other hand, if Serial.write is called on a full buffer from inside of an ISR (a common occurrence when trying to debug ISR triggering), the entire processor won't lock up and have to be reset. I also added the keyword for this function so it lights up.

… decides whether to wait for the ISR to open up some space, or quits immediately to avoid hanging the processor. (If this situation was caused from within another ISR). Added HardwareSerial::waitForBufferSpace(uint8_t v) which takes TRUE or FALSE so the user can make that choice.
@neophob
Copy link

neophob commented Oct 31, 2012

this bug is fixed now.

@matthijskooijman
Copy link
Collaborator

Is this bug really fixed? I think you can still lock up the Arduino by printing more than 64 bytes from an ISR?

The issue this pullreq belongs to has been converted to github under #672, btw.

@ffissore ffissore added the New label Feb 27, 2014
@cmaglie cmaglie added Core and removed New labels Apr 13, 2014
@cmaglie
Copy link
Member

cmaglie commented Apr 13, 2014

Fixed with #672.

@cmaglie cmaglie closed this Apr 13, 2014
tbowmo pushed a commit to tbowmo/Arduino that referenced this pull request Jul 14, 2016
fix a case where parent distance from repeater get stuck at 255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Related to the code for the standard Arduino API Component: HardwareSerial The hardware serial functionality of the core libraries feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants