summaryrefslogtreecommitdiff
path: root/src/modem.cc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-02-05 17:33:02 +0100
committerDaniel Friesel <derf@finalrewind.org>2016-02-05 17:33:02 +0100
commitf88c1fde18146fd1bf543399da0f6584c3fd4a81 (patch)
treed93b2d30ac2b83cc739e1ee550179c1792b1e37e /src/modem.cc
parent4bf560b6f3ef6089af04dfc56d078b9978496b07 (diff)
add (untested) Hamming forward error correction code and corresponding class
The system now uses a FECModem instance, which inherits the receive methods etc. from Modem. Up next: Make the modem's buffer read methods private and expose them in error-corrected FECModem methods instead
Diffstat (limited to 'src/modem.cc')
-rw-r--r--src/modem.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modem.cc b/src/modem.cc
index e9cddb7..472fe04 100644
--- a/src/modem.cc
+++ b/src/modem.cc
@@ -10,8 +10,9 @@
#include <avr/io.h>
#include <stdlib.h>
#include "modem.h"
+#include "fecmodem.h"
-Modem modem;
+extern FECModem modem;
/*
* Returns number of available bytes in ringbuffer or 0 if empty
@@ -24,7 +25,7 @@ uint8_t Modem::buffer_available() {
* Store 1 byte in ringbuffer
*/
inline void Modem::buffer_put(const uint8_t c) {
- if (modem.buffer_available() != MODEM_BUFFER_SIZE) {
+ if (buffer_available() != MODEM_BUFFER_SIZE) {
buffer[buffer_head++ % MODEM_BUFFER_SIZE] = c;
}
}