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.
Dependencies: SoftSerial SDFileSystem mbed wave_player
Diff: MySoftSerial.cpp
- Revision:
- 17:8683abdc1912
- Parent:
- 16:1a0589d846bf
- Child:
- 19:822d93e0bf34
--- a/MySoftSerial.cpp Wed May 10 14:31:39 2017 +0000
+++ b/MySoftSerial.cpp Wed May 10 17:31:22 2017 +0200
@@ -3,9 +3,10 @@
//
#include "MySoftSerial.h"
+#include "Manchester.h"
MySoftSerial::MySoftSerial(PinName TX, PinName RX, const char *name) : SoftSerial(TX, RX, name) {
-
+ format(16, SoftSerial::None, 1);
}
MySoftSerial::~MySoftSerial() {
@@ -13,9 +14,27 @@
}
int MySoftSerial::putc(int c) {
+ c = Manchester::encode(c);
return _putc(c);
}
int MySoftSerial::getc() {
- return _getc();
+ return Manchester::decode(_getc());
+}
+
+void MySoftSerial::prepare_tx(int c) {
+
+ SoftSerial::prepare_tx(c);
}
+
+void MySoftSerial::baud(int baudrate) {
+ SoftSerial::baud(baudrate);
+}
+
+int MySoftSerial::readable() {
+ return SoftSerial::readable();
+}
+
+int MySoftSerial::writeable() {
+ return SoftSerial::writeable();
+}