diff --git a/firmware/logf.c b/firmware/logf.c index 3a6b696b1a..fc81ced779 100644 --- a/firmware/logf.c +++ b/firmware/logf.c @@ -188,7 +188,7 @@ static int logf_push(void *userp, unsigned char c) logfbuffer[logfindex++] = c; check_logfindex(); -#if defined(HAVE_SERIAL) && !defined(SIMULATOR) +#if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL) if(c != '\0') { char buf[2]; @@ -225,7 +225,7 @@ void _logf(const char *fmt, ...) /* add trailing zero */ logf_push(NULL, '\0'); -#if defined(HAVE_SERIAL) && !defined(SIMULATOR) +#if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL) serial_tx("\r\n"); #endif #ifdef USB_ENABLE_SERIAL diff --git a/tools/configure b/tools/configure index 795966c9eb..f9a5869b6b 100755 --- a/tools/configure +++ b/tools/configure @@ -16,6 +16,7 @@ GLOBAL_LDOPTS="" extradefines="" use_logf="#undef ROCKBOX_HAS_LOGF" use_bootchart="#undef DO_BOOTCHART" +use_logf_serial="#undef LOGF_SERIAL" scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` @@ -715,7 +716,7 @@ whichadvanced () { echo "" printf "Enter your developer options (press only enter when done)\n\ (D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\ -(T)est plugins, S(m)all C lib:" +(T)est plugins, S(m)all C lib, Logf to Ser(i)al port:" if [ "$modelname" = "archosplayer" ]; then printf ", Use (A)TA poweroff" fi @@ -762,10 +763,15 @@ whichadvanced () { extradefines="$extradefines -DHAVE_TEST_PLUGINS" ;; [Cc]) - echo "bootchart enabled (logf also enabled)" + echo "bootchart enabled (logf also enabled)" bootchart="yes" logf="yes" ;; + [Ii]) + echo "Logf to serial port enabled (logf also enabled)" + logf="yes" + logf_serial="yes" + ;; [Ss]) echo "Simulator build enabled" simulator="yes" @@ -845,6 +851,9 @@ whichadvanced () { if [ "yes" = "$logf" ]; then use_logf="#define ROCKBOX_HAS_LOGF 1" fi + if [ "yes" = "$logf_serial" ]; then + use_logf_serial="#define LOGF_SERIAL 1" + fi if [ "yes" = "$bootchart" ]; then use_bootchart="#define DO_BOOTCHART 1" fi @@ -3707,6 +3716,9 @@ cat > autoconf.h <