Switch back to 115.2kbps
[rmslog.git] / rmslog / main.c
index aa33cf708434b38a3331380568c6cb463a60109d..9f52d5f789ea5e4fe76fad5468140137ba0ab3d4 100644 (file)
@@ -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