From: Bernie Innocenti Date: Fri, 25 Mar 2011 18:25:43 +0000 (-0400) Subject: Switch back to 115.2kbps X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=11db4fb1c52b7460f55d84402d5eb44da7bbda99;p=rmslog.git Switch back to 115.2kbps --- diff --git a/rmslog/main.c b/rmslog/main.c index aa33cf7..9f52d5f 100644 --- a/rmslog/main.c +++ b/rmslog/main.c @@ -5,7 +5,9 @@ * * \brief Serial data logger for RMS * - * This application logs data + * This application records all incoming data from an RS-232 serial port + * to a file on a FAT-formatted SD card. It can be used to log kernel + * console messages. */ #include "hw/hw_led.h" @@ -132,11 +134,15 @@ static void init(void) /* Initialize UART0 */ ser_init(&ser, SER_UART0); - //FIXME + + //FIXME: The 16MHz arduino clock causes 3.5% baudrate error at 115200 //ser_setbaudrate(&ser, 115200); - //ser_setbaudrate(&ser, 57600); - //UCSR0A = BV(U2X0); - ser_setbaudrate(&ser, 19200); + ser_setbaudrate(&ser, 57600); + UCSR0A = BV(U2X0); + + // At this baud rate, we're fast enought to write a continuous + // input stream to the SD card + //ser_setbaudrate(&ser, 19200); /* Initialize LED driver */ LED_INIT(); @@ -196,8 +202,6 @@ int main(void) LED_ON(); fat_write_file(fd, (void *)buf, size); sync_pending = true; - sprintf(buf, "%d\r\n", size); - ser_write(&ser, buf, strlen(buf)); LED_OFF(); } else