*
* \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"
/* 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();
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