diff options
author | Ralf Ertzinger <rockbox@camperquake.de> | 2011-09-09 12:28:36 +0200 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2012-02-16 14:44:43 +0100 |
commit | d2f97da668836f5d825c9aaef0d58dea64fc4dd5 (patch) | |
tree | e55f90f533302a21f41d2633978e45f6099f77fc | |
parent | b193b75f62ff3be76f3cec120fe906c474b5caeb (diff) | |
download | rockbox-d2f97da668836f5d825c9aaef0d58dea64fc4dd5.tar.gz rockbox-d2f97da668836f5d825c9aaef0d58dea64fc4dd5.zip |
Make logf() output to serial optional
Only output logf() to the serial port if LOGF_SERIAL is defined
(in addition to HAVE_SERIAL). Add an option to advanced configure
to set this (defaults to off).
Change-Id: I13d0f5df391e5371f7797f46a3faaf7a6974b9e4
Reviewed-on: http://gerrit.rockbox.org/92
Reviewed-by: Björn Stenberg <bjorn@haxx.se>
-rw-r--r-- | firmware/logf.c | 4 | ||||
-rwxr-xr-x | tools/configure | 16 |
2 files changed, 16 insertions, 4 deletions
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) | |||
188 | logfbuffer[logfindex++] = c; | 188 | logfbuffer[logfindex++] = c; |
189 | check_logfindex(); | 189 | check_logfindex(); |
190 | 190 | ||
191 | #if defined(HAVE_SERIAL) && !defined(SIMULATOR) | 191 | #if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL) |
192 | if(c != '\0') | 192 | if(c != '\0') |
193 | { | 193 | { |
194 | char buf[2]; | 194 | char buf[2]; |
@@ -225,7 +225,7 @@ void _logf(const char *fmt, ...) | |||
225 | /* add trailing zero */ | 225 | /* add trailing zero */ |
226 | logf_push(NULL, '\0'); | 226 | logf_push(NULL, '\0'); |
227 | 227 | ||
228 | #if defined(HAVE_SERIAL) && !defined(SIMULATOR) | 228 | #if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL) |
229 | serial_tx("\r\n"); | 229 | serial_tx("\r\n"); |
230 | #endif | 230 | #endif |
231 | #ifdef USB_ENABLE_SERIAL | 231 | #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="" | |||
16 | extradefines="" | 16 | extradefines="" |
17 | use_logf="#undef ROCKBOX_HAS_LOGF" | 17 | use_logf="#undef ROCKBOX_HAS_LOGF" |
18 | use_bootchart="#undef DO_BOOTCHART" | 18 | use_bootchart="#undef DO_BOOTCHART" |
19 | use_logf_serial="#undef LOGF_SERIAL" | ||
19 | 20 | ||
20 | scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` | 21 | scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'` |
21 | 22 | ||
@@ -715,7 +716,7 @@ whichadvanced () { | |||
715 | echo "" | 716 | echo "" |
716 | printf "Enter your developer options (press only enter when done)\n\ | 717 | printf "Enter your developer options (press only enter when done)\n\ |
717 | (D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\ | 718 | (D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\ |
718 | (T)est plugins, S(m)all C lib:" | 719 | (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:" |
719 | if [ "$modelname" = "archosplayer" ]; then | 720 | if [ "$modelname" = "archosplayer" ]; then |
720 | printf ", Use (A)TA poweroff" | 721 | printf ", Use (A)TA poweroff" |
721 | fi | 722 | fi |
@@ -762,10 +763,15 @@ whichadvanced () { | |||
762 | extradefines="$extradefines -DHAVE_TEST_PLUGINS" | 763 | extradefines="$extradefines -DHAVE_TEST_PLUGINS" |
763 | ;; | 764 | ;; |
764 | [Cc]) | 765 | [Cc]) |
765 | echo "bootchart enabled (logf also enabled)" | 766 | echo "bootchart enabled (logf also enabled)" |
766 | bootchart="yes" | 767 | bootchart="yes" |
767 | logf="yes" | 768 | logf="yes" |
768 | ;; | 769 | ;; |
770 | [Ii]) | ||
771 | echo "Logf to serial port enabled (logf also enabled)" | ||
772 | logf="yes" | ||
773 | logf_serial="yes" | ||
774 | ;; | ||
769 | [Ss]) | 775 | [Ss]) |
770 | echo "Simulator build enabled" | 776 | echo "Simulator build enabled" |
771 | simulator="yes" | 777 | simulator="yes" |
@@ -845,6 +851,9 @@ whichadvanced () { | |||
845 | if [ "yes" = "$logf" ]; then | 851 | if [ "yes" = "$logf" ]; then |
846 | use_logf="#define ROCKBOX_HAS_LOGF 1" | 852 | use_logf="#define ROCKBOX_HAS_LOGF 1" |
847 | fi | 853 | fi |
854 | if [ "yes" = "$logf_serial" ]; then | ||
855 | use_logf_serial="#define LOGF_SERIAL 1" | ||
856 | fi | ||
848 | if [ "yes" = "$bootchart" ]; then | 857 | if [ "yes" = "$bootchart" ]; then |
849 | use_bootchart="#define DO_BOOTCHART 1" | 858 | use_bootchart="#define DO_BOOTCHART 1" |
850 | fi | 859 | fi |
@@ -3707,6 +3716,9 @@ cat > autoconf.h <<EOF | |||
3707 | /* Define this if you build rockbox to support the logf logging and display */ | 3716 | /* Define this if you build rockbox to support the logf logging and display */ |
3708 | ${use_logf} | 3717 | ${use_logf} |
3709 | 3718 | ||
3719 | /* Define this if you want logf to output to the serial port */ | ||
3720 | ${use_logf_serial} | ||
3721 | |||
3710 | /* Define this to record a chart with timings for the stages of boot */ | 3722 | /* Define this to record a chart with timings for the stages of boot */ |
3711 | ${use_bootchart} | 3723 | ${use_bootchart} |
3712 | 3724 | ||