Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 4:c947442469dd, committed 2012-10-13
- Comitter:
- AlexAllen
- Date:
- Sat Oct 13 11:59:13 2012 +0000
- Parent:
- 3:22a375fbcb3a
- Parent:
- 2:f2cf3a42e690
- Commit message:
- Tried a merge
Changed in this revision
UM12.cpp | Show annotated file Show diff for this revision Revisions of this file |
UM12.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/UM12.cpp Sat Oct 13 11:51:43 2012 +0000 +++ b/UM12.cpp Sat Oct 13 11:59:13 2012 +0000 @@ -60,6 +60,11 @@ putc(msg); } +void UM12::send(bool msg) +{ + putc((int) msg); +} + void UM12::send(int msg) { char *ch; @@ -80,6 +85,12 @@ return msg; } +bool UM12::receive(bool &msg) +{ + msg = getc(); + return msg; +} + int UM12::receive(int &msg) { int i, intsize = sizeof(int);
--- a/UM12.h Sat Oct 13 11:51:43 2012 +0000 +++ b/UM12.h Sat Oct 13 11:59:13 2012 +0000 @@ -34,10 +34,12 @@ void reset(); // Reset UM12 void send(char msg); // Send a single char + void send(bool msg); // Send a boolean message void send(int msg); // Send a four byte integer void send(float msg); // Send a four byte floating point number char receive(char &msg); // Receive a single char + bool receive(bool &msg); // Receive a boolean int receive(int &msg); // Receive a four byte integer float receive(float &msg); // Receive a four byte floating point number