Myserial Library extends RawSerial
Revision 11:34ae126807a0, committed 2014-07-03
- Comitter:
- naao
- Date:
- Thu Jul 03 02:37:41 2014 +0000
- Parent:
- 10:930d325f3d31
- Child:
- 12:02b3877b48c6
- Commit message:
- changed library RawSerial to Serial
Changed in this revision
MySerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
MySerial.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MySerial.cpp Fri Jun 27 15:33:01 2014 +0000 +++ b/MySerial.cpp Thu Jul 03 02:37:41 2014 +0000 @@ -1,6 +1,6 @@ #include "MySerial.h" -MySerial::MySerial(PinName tx,PinName rx):RawSerial(tx,rx) //constructor +MySerial::MySerial(PinName tx,PinName rx, char *name):Serial(tx,rx,name) //constructor { fRxStartWait = 0.01; //wait getting a 1st char after interrupted fRxEachWait = 0.001; //wait getting each char
--- a/MySerial.h Fri Jun 27 15:33:01 2014 +0000 +++ b/MySerial.h Thu Jul 03 02:37:41 2014 +0000 @@ -21,7 +21,8 @@ * #include "mbed.h" * #include "MySerial.h" * - * MySerial pc(USBTX,USBRX); //instance of MySerial Class + * char *name = "test"; + * MySerial pc(USBTX,USBRX,name); //instance of MySerial Class * char cWord[16]; //receive chars or cWord[256], cWord[1024] etc.. * * void readbuf() @@ -37,7 +38,7 @@ * } * @endcode */ -class MySerial : public RawSerial{ +class MySerial : public Serial{ public: /** constructor to get chars received by serial @@ -45,7 +46,7 @@ * @param PinName tx * @param PinName rx */ - MySerial(PinName tx, PinName rx); + MySerial(PinName tx, PinName rx, char *name); /** set wait getting chars after interrupted *