Serial Communicate Control Class. This has printf() and Tx & Rx buffer with (RxIRQ) RingBuffer, andmore can add user rxFunc to RxIrq.
Diff: mySerial.cpp
- Revision:
- 1:3ebb72e37fc5
- Parent:
- 0:fa077fb53f44
- Child:
- 2:d234f6f65fb9
--- a/mySerial.cpp Thu Jan 21 06:35:10 2016 +0000 +++ b/mySerial.cpp Thu Jan 21 06:52:31 2016 +0000 @@ -49,37 +49,12 @@ string mySerial::getLine() { - /* - string tmp= this->read(); - if(tmp.empty()) - return ""; - - // tmp is not empty. - int idx= tmp.rfind('\r'); - if(idx == string::npos) { - ringBufRx.set(tmp); // 戻す - return ""; - } - */ - _read(); // RingBuf is empty of doesm't find CR. if(ringBufRx.empty() || !ringBufRx.chkCR()) return ""; return ringBufRx.getLine(); - /* - string tmp= ringBufRx.get(); - // find \r - if(tmp[++idx] == '\n') - idx++; - - // idxは改行後の文字先頭Indexを示す。 - string rtn= tmp.substr(0, idx); - tmp= tmp.substr(idx); - ringBufRx.set(tmp); - return rtn; - */ } void mySerial::sendLine(string str, bool addCR)