projects
/
rmslog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a93a61d
)
Switch back to 115.2kbps
author
Bernie Innocenti
<bernie@codewiz.org>
Fri, 25 Mar 2011 18:25:43 +0000
(14:25 -0400)
committer
Bernie Innocenti
<bernie@codewiz.org>
Fri, 25 Mar 2011 18:25:43 +0000
(14:25 -0400)
rmslog/main.c
patch
|
blob
|
history
diff --git
a/rmslog/main.c
b/rmslog/main.c
index aa33cf708434b38a3331380568c6cb463a60109d..9f52d5f789ea5e4fe76fad5468140137ba0ab3d4 100644
(file)
--- a/
rmslog/main.c
+++ b/
rmslog/main.c
@@
-5,7
+5,9
@@
*
* \brief Serial data logger for RMS
*
*
* \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"
*/
#include "hw/hw_led.h"
@@
-132,11
+134,15
@@
static void init(void)
/* Initialize UART0 */
ser_init(&ser, SER_UART0);
/* 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, 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();
/* Initialize LED driver */
LED_INIT();
@@
-196,8
+202,6
@@
int main(void)
LED_ON();
fat_write_file(fd, (void *)buf, size);
sync_pending = true;
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
LED_OFF();
}
else