diff --git a/Modem/afsk.c b/Modem/afsk.c index 99f5bd9..91b3fa3 100644 --- a/Modem/afsk.c +++ b/Modem/afsk.c @@ -81,9 +81,9 @@ INLINE uint8_t sinSample(uint16_t i) { // Phase sync constants #define PHASE_BITS 8 -#define PHASE_INC 1 +#define PHASE_INC 1 // FIXME: originally 1 #define PHASE_MAX (SAMPLESPERBIT * PHASE_BITS) -#define PHASE_THRESHOLD (PHASE_MAX / 2) +#define PHASE_THRESHOLD (PHASE_MAX / 2) + (PHASE_MAX / 8) // FIXME: originally /2 // Modulation constants #define MARK_FREQ 1200 diff --git a/Modem/cfg/cfg_debug.h b/Modem/cfg/cfg_debug.h index cd83989..1063984 100644 --- a/Modem/cfg/cfg_debug.h +++ b/Modem/cfg/cfg_debug.h @@ -49,7 +49,7 @@ * Baudrate for the debug console. * $WIZ$ type = "int"; min = 300 */ -#define CONFIG_KDEBUG_BAUDRATE 57600UL +#define CONFIG_KDEBUG_BAUDRATE 115200UL /** * Clock source for the UART module. You need to write the code to reprogram the respective clock at the required frequency in your project before calling kdbg_init(). diff --git a/Modem/config.h b/Modem/config.h index f37a75b..b44486a 100644 --- a/Modem/config.h +++ b/Modem/config.h @@ -11,7 +11,7 @@ #define CONFIG_AFSK_RXTIMEOUT 0 // How long a read operation from the modem // will wait for data before timing out. -#define CONFIG_AFSK_PREAMBLE_LEN 650UL // The length of the packet preamble in milliseconds +#define CONFIG_AFSK_PREAMBLE_LEN 1000UL // The length of the packet preamble in milliseconds #define CONFIG_AFSK_TRAILER_LEN 100UL // The length of the packet tail in milliseconds #endif \ No newline at end of file diff --git a/Modem/main.c b/Modem/main.c index f281e4b..396e84a 100644 --- a/Modem/main.c +++ b/Modem/main.c @@ -66,7 +66,7 @@ static void init(void) // Initialize serial comms on UART0, // which is the hardware serial on arduino ser_init(&ser, SER_UART0); - ser_setbaudrate(&ser, 57600); + ser_setbaudrate(&ser, 115200); // Create a modem context afsk_init(&afsk, ADC_CH); @@ -102,7 +102,7 @@ int main(void) // and the byte is not a "transmit" (newline) character, // we should store it for transmission. if ((serialLen < MP1_MAX_FRAME_LENGTH) && (sbyte != 138)) { - kprintf("%d\n", sbyte); + kprintf("Byte: %d\n", sbyte); // Put the read byte into the buffer; serialBuffer[serialLen] = sbyte; // Increment the read length counter @@ -126,7 +126,7 @@ int main(void) } // Periodically send test data if we should do so - if (TEST_TX && timer_clock() - start > ms_to_ticks(4000L)) { + if (TEST_TX && timer_clock() - start > ms_to_ticks(5000L)) { // Reset the timer counter; start = timer_clock(); // And send a test packet! diff --git a/Modem/protocol/mp1.c b/Modem/protocol/mp1.c index 97791c6..f107a3d 100644 --- a/Modem/protocol/mp1.c +++ b/Modem/protocol/mp1.c @@ -45,8 +45,8 @@ void mp1Poll(MP1 *mp1) { } else { // Checksum was incorrect mp1Decode(mp1); - kprintf("Incorrect checksum. Found %d, ", mp1->buffer[mp1->packetLength]); - kprintf("should be %d\n", mp1->checksum_in); + //kprintf("Incorrect checksum. Found %d, ", mp1->buffer[mp1->packetLength]); + //kprintf("should be %d\n", mp1->checksum_in); } } // If the above is not the case, this must be the diff --git a/buildrev.h b/buildrev.h index 16f61fb..58741bc 100644 --- a/buildrev.h +++ b/buildrev.h @@ -1,2 +1,2 @@ -#define VERS_BUILD 412 +#define VERS_BUILD 438 #define VERS_HOST "vixen"