From 997e64ff8b9d8fd7501bd31ad79d3e3e2844cb82 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 5 Aug 2015 21:02:16 +0200 Subject: [PATCH] Increased max frame length. Other minor tweaks. --- hardware/AFSK.c | 6 +++--- hardware/AFSK.h | 9 +++++++-- protocol/AX25.h | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hardware/AFSK.c b/hardware/AFSK.c index c8c5f90..05f89e7 100644 --- a/hardware/AFSK.c +++ b/hardware/AFSK.c @@ -379,7 +379,7 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) { // First we bitshift everything 1 left afsk->sampledBits <<= 1; // And then add the sampled bit to our delay line - afsk->sampledBits |= (afsk->iirY[1] > 0) ? 1 : 0; + afsk->sampledBits |= (afsk->iirY[1] > 0) ? 0 : 1; // Put the current raw sample in the delay FIFO fifo_push(&afsk->delayFifo, currentSample); @@ -464,7 +464,7 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) { ///////////////////////////////////////////////// // Now we can pass the actual bit to the HDLC parser. - // We are using NRZ coding, so if 2 consecutive bits + // We are using NRZ-S coding, so if 2 consecutive bits // have the same value, we have a 1, otherwise a 0. // We use the TRANSITION_FOUND function to determine this. // @@ -476,7 +476,7 @@ void AFSK_adc_isr(Afsk *afsk, int8_t currentSample) { // not be able to synchronize our phase to the transmitter // and would start experiencing "bit slip". // - // By combining bit-stuffing with NRZ coding, we ensure + // By combining bit-stuffing with NRZ-S coding, we ensure // that the signal will regularly make transitions // that we can use to synchronize our phase. // diff --git a/hardware/AFSK.h b/hardware/AFSK.h index aecce47..cd2fc92 100644 --- a/hardware/AFSK.h +++ b/hardware/AFSK.h @@ -52,11 +52,16 @@ inline static uint8_t sinSample(uint16_t i) { #define SAMPLESPERBIT (SAMPLERATE / BITRATE) #define PHASE_INC 1 // Nudge by an eigth of a sample each adjustment -#if BITRATE == 960 +#if BITRATE == 300 + #define FILTER_CUTOFF 600 + #define MARK_FREQ 1600 + #define SPACE_FREQ 1800 + #define PHASE_BITS 10 // How much to increment phase counter each sample +#elif BITRATE == 960 #define FILTER_CUTOFF 600 #define MARK_FREQ 960 #define SPACE_FREQ 1600 - #define PHASE_BITS 10 // How much to increment phase counter each sample + #define PHASE_BITS 10 #elif BITRATE == 1200 #define FILTER_CUTOFF 600 #define MARK_FREQ 1200 diff --git a/protocol/AX25.h b/protocol/AX25.h index 0314bdb..938abb9 100644 --- a/protocol/AX25.h +++ b/protocol/AX25.h @@ -7,7 +7,7 @@ #define AX25_MIN_FRAME_LEN 18 #ifndef CUSTOM_FRAME_SIZE - #define AX25_MAX_FRAME_LEN 620 + #define AX25_MAX_FRAME_LEN 792 #else #define AX25_MAX_FRAME_LEN CUSTOM_FRAME_SIZE #endif