8N1 Serial
This commit is contained in:
parent
4b515eab41
commit
b01eba0cdf
|
@ -71,6 +71,11 @@ static void init(void)
|
||||||
ser_init(&ser, SER_UART0);
|
ser_init(&ser, SER_UART0);
|
||||||
ser_setbaudrate(&ser, 115200);
|
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
|
// Create a modem context
|
||||||
afsk_init(&afsk, ADC_CH);
|
afsk_init(&afsk, ADC_CH);
|
||||||
// ... and a protocol context with the modem
|
// ... and a protocol context with the modem
|
||||||
|
@ -105,7 +110,7 @@ int main(void)
|
||||||
// If we have not yet surpassed the maximum frame length
|
// If we have not yet surpassed the maximum frame length
|
||||||
// and the byte is not a "transmit" (newline) character,
|
// and the byte is not a "transmit" (newline) character,
|
||||||
// we should store it for transmission.
|
// 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;
|
// Put the read byte into the buffer;
|
||||||
serialBuffer[serialLen] = sbyte;
|
serialBuffer[serialLen] = sbyte;
|
||||||
// Increment the read length counter
|
// Increment the read length counter
|
||||||
|
@ -137,6 +142,7 @@ int main(void)
|
||||||
// And send a test packet!
|
// And send a test packet!
|
||||||
uint8_t output[sizeof(TEST_PACKET)] = TEST_PACKET;
|
uint8_t output[sizeof(TEST_PACKET)] = TEST_PACKET;
|
||||||
mp1Send(&mp1, output, sizeof(TEST_PACKET));
|
mp1Send(&mp1, output, sizeof(TEST_PACKET));
|
||||||
|
kprintf("TX done\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define VERS_BUILD 1374
|
#define VERS_BUILD 1392
|
||||||
#define VERS_HOST "vixen"
|
#define VERS_HOST "shard"
|
||||||
|
|
Loading…
Reference in New Issue