Skip to content

Enhancements in SoftwareSerial lib #1146

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

Merged
merged 2 commits into from
Dec 2, 2012
Merged

Enhancements in SoftwareSerial lib #1146

merged 2 commits into from
Dec 2, 2012

Conversation

sebastienjean
Copy link
Contributor

I tried to use SotfwareSerial to communicate with a device at 600 Baud. Unfortunately, i did not succeed. And after spending some time to figure out the failure, i noticed that

  • the 600 Baud speed was simply not supported (no delays in DELAY_TABLE)
  • begin(long speed) was returning normally even if speed was not supported.

So, i have added a 600 Baud line in DELAY_TABLE for each CPU frequency. This has been fully tested for 16 MHz. I have also changed the return type of begin(long speed) from void to bool in order to notify unsupported speeds.

- Added a 600 Baud line in DELAY_TABLE, for each CPU frequency.
(successfully tested for 16 MHz)

- begin(long speed) now returns a bool indicating if speed has been
found in DELAY_TABLE (if not, the method returns false immediately)
@cmaglie
Copy link
Member

cmaglie commented Dec 2, 2012

Thanks,

can you repost the patch without the change to begin() function? The supported speeds are documented in the reference page, I don't feel the need to have a notification returned from begin.
The point is: even knowing at runtime that the speed is not supported, what you can do afterward (besides halting)?

http://arduino.cc/en/Serial/Begin

@sebastienjean
Copy link
Contributor Author

Done.
I thought a non-void returning type could have been useful at init time when associated to a notification using a LED.
Anyway, one can simply RTFM (as i did ;-) ).

cmaglie added a commit that referenced this pull request Dec 2, 2012
Enhancements in SoftwareSerial lib
@cmaglie cmaglie merged commit 24cef2e into arduino:master Dec 2, 2012
@cmaglie
Copy link
Member

cmaglie commented Dec 2, 2012

Great! Thank you.

@sebastienjean
Copy link
Contributor Author

Thanks are for you.
How can the reference be in sync with the code, in order to mention 600 Baud as a supported rate ?

@cmaglie
Copy link
Member

cmaglie commented Dec 2, 2012

Just updated also the doc page ;)

@sebastienjean
Copy link
Contributor Author

But someone has also not to forget this one for the next release
http://arduino.cc/en/Reference/SoftwareSerialBegin

@cmaglie
Copy link
Member

cmaglie commented Dec 2, 2012

Whoops. Ok fixed.

oriregev pushed a commit to oriregev/Arduino that referenced this pull request Dec 20, 2013
Enhancements in SoftwareSerial lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants