Buffered Serial , Using For STM32 Nucleo F401RE and NodeMCU at command
Dependents: NucleoF401_ESP8622
Fork of BufferedSerial by
Revision 11:ea5ad8e00c99, committed 2015-02-18
- Comitter:
- veyselka
- Date:
- Wed Feb 18 13:40:14 2015 +0000
- Parent:
- 10:9ee15ae3d1a3
- Commit message:
- None
Changed in this revision
| BufferedSerial.cpp | Show annotated file Show diff for this revision Revisions of this file |
| BufferedSerial.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/BufferedSerial.cpp Wed Jan 07 18:37:11 2015 +0000
+++ b/BufferedSerial.cpp Wed Feb 18 13:40:14 2015 +0000
@@ -71,7 +71,7 @@
while(*(ptr) != 0) {
_txbuf = *(ptr++);
}
- _txbuf = '\n'; // done per puts definition
+ // _txbuf = '\n'; // done per puts definition
BufferedSerial::prime();
return (ptr - s) + 1;
@@ -117,6 +117,13 @@
}
+void BufferedSerial::clear(void)
+{
+ _rxbuf.clear(); // note: look if things are in the buffer
+}
+
+
+
void BufferedSerial::rxIrq(void)
{
// read from the peripheral and make sure something is available
--- a/BufferedSerial.h Wed Jan 07 18:37:11 2015 +0000
+++ b/BufferedSerial.h Wed Feb 18 13:40:14 2015 +0000
@@ -138,6 +138,8 @@
* @return The number of bytes written to the Serial Port Buffer
*/
virtual ssize_t write(const void *s, std::size_t length);
+
+ virtual void clear(void);
};
#endif
