From 13af4dcd2bd613ebe0bea029d02698e7fd7e008d Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sun, 13 Apr 2014 15:44:59 +0200 Subject: [PATCH] Before Hamming code --- Modem/afsk.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Modem/afsk.c b/Modem/afsk.c index 43fc930..733d016 100644 --- a/Modem/afsk.c +++ b/Modem/afsk.c @@ -369,20 +369,9 @@ void afsk_adc_isr(Afsk *afsk, int8_t currentSample) { afsk->actualBits <<= 1; // We determine the actual bit value by reading - // the last 5 sampled bits. If there is three or + // the last 3 sampled bits. If there is three or // more 1's, we will assume that the transmitter // sent us a one, otherwise we assume a zero - - // uint8_t bits = afsk->sampledBits & 0x0f; - // uint8_t c = 0; - // c += bits & BV(1); - // c += bits & BV(2); - // c += bits & BV(3); - // c += bits & BV(4); - // c += bits & BV(5); - // if (c >= 3) afsk->actualBits |= 1; - - //// Alternative using only three bits ////////// uint8_t bits = afsk->sampledBits & 0x07; if (bits == 0x07 || // 111 bits == 0x06 || // 110 @@ -391,6 +380,16 @@ void afsk_adc_isr(Afsk *afsk, int8_t currentSample) { ) { afsk->actualBits |= 1; } + + //// Alternative using five bits //////////////// + // uint8_t bits = afsk->sampledBits & 0x0f; + // uint8_t c = 0; + // c += bits & BV(1); + // c += bits & BV(2); + // c += bits & BV(3); + // c += bits & BV(4); + // c += bits & BV(5); + // if (c >= 3) afsk->actualBits |= 1; ///////////////////////////////////////////////// // Now we can pass the actual bit to the HDLC parser.