From b01eba0cdf902851cd54e8e17a1b2ae8d4480365 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 23 Apr 2014 22:49:04 +0200 Subject: [PATCH] 8N1 Serial --- Modem/main.c | 8 +++++++- buildrev.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Modem/main.c b/Modem/main.c index 0da2aac..691d18e 100644 --- a/Modem/main.c +++ b/Modem/main.c @@ -71,6 +71,11 @@ static void init(void) ser_init(&ser, SER_UART0); ser_setbaudrate(&ser, 115200); + // For some reason BertOS sets the serial + // to 7 bit characters by default. We set + // it to 8 instead. + UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); + // Create a modem context afsk_init(&afsk, ADC_CH); // ... and a protocol context with the modem @@ -105,7 +110,7 @@ int main(void) // If we have not yet surpassed the maximum frame length // and the byte is not a "transmit" (newline) character, // we should store it for transmission. - if ((serialLen < MP1_MAX_FRAME_LENGTH) && (sbyte != 138)) { + if ((serialLen < MP1_MAX_FRAME_LENGTH) && (sbyte != 10)) { // Put the read byte into the buffer; serialBuffer[serialLen] = sbyte; // Increment the read length counter @@ -137,6 +142,7 @@ int main(void) // And send a test packet! uint8_t output[sizeof(TEST_PACKET)] = TEST_PACKET; mp1Send(&mp1, output, sizeof(TEST_PACKET)); + kprintf("TX done\n"); } } return 0; diff --git a/buildrev.h b/buildrev.h index 0eef8e8..add480e 100644 --- a/buildrev.h +++ b/buildrev.h @@ -1,2 +1,2 @@ -#define VERS_BUILD 1374 -#define VERS_HOST "vixen" +#define VERS_BUILD 1392 +#define VERS_HOST "shard"