summaryrefslogtreecommitdiffstats
path: root/firmware/logf.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-03-02 20:45:33 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-03-02 20:45:33 +0000
commit776d015cc492cb9c682bb1d223011b7a808011e8 (patch)
tree61e3270b59b1442872779f0ea86ea237d6c92513 /firmware/logf.c
parentb3ab7884110b6e3849add5573d1f2a96c7603cd4 (diff)
downloadrockbox-776d015cc492cb9c682bb1d223011b7a808011e8.tar.gz
rockbox-776d015cc492cb9c682bb1d223011b7a808011e8.tar.bz2
rockbox-776d015cc492cb9c682bb1d223011b7a808011e8.zip
implement logf over usb-serial. Needs USB_SERIAL defined in usb_core.h to work, and needs to be enabled in the debug menu.
It stops sending data after a while for unknown reasons. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16486 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/logf.c')
-rw-r--r--firmware/logf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/logf.c b/firmware/logf.c
index 2056db5cc4..da05a0a0c7 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -32,6 +32,11 @@
#include "logf.h"
#include "serial.h"
+#ifdef HAVE_USBSTACK
+#include "usb_core.h"
+#include "usbstack/usb_serial.h"
+#endif
+
/* Only provide all this if asked to */
#ifdef ROCKBOX_HAS_LOGF
@@ -107,6 +112,11 @@ void _logf(const char *format, ...)
serial_tx(ptr);
serial_tx("\r\n");
#endif
+#ifdef USB_SERIAL
+ usb_serial_send(ptr,len);
+ usb_serial_send("\r\n",2);
+#endif
+
va_end(ap);
if(len < MAX_LOGF_ENTRY)
/* pad with spaces up to the MAX_LOGF_ENTRY byte border */