mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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>
This commit is contained in:
parent
b193b75f62
commit
d2f97da668
2 changed files with 16 additions and 4 deletions
|
@ -188,7 +188,7 @@ static int logf_push(void *userp, unsigned char c)
|
||||||
logfbuffer[logfindex++] = c;
|
logfbuffer[logfindex++] = c;
|
||||||
check_logfindex();
|
check_logfindex();
|
||||||
|
|
||||||
#if defined(HAVE_SERIAL) && !defined(SIMULATOR)
|
#if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL)
|
||||||
if(c != '\0')
|
if(c != '\0')
|
||||||
{
|
{
|
||||||
char buf[2];
|
char buf[2];
|
||||||
|
@ -225,7 +225,7 @@ void _logf(const char *fmt, ...)
|
||||||
/* add trailing zero */
|
/* add trailing zero */
|
||||||
logf_push(NULL, '\0');
|
logf_push(NULL, '\0');
|
||||||
|
|
||||||
#if defined(HAVE_SERIAL) && !defined(SIMULATOR)
|
#if defined(HAVE_SERIAL) && !defined(SIMULATOR) && defined(LOGF_SERIAL)
|
||||||
serial_tx("\r\n");
|
serial_tx("\r\n");
|
||||||
#endif
|
#endif
|
||||||
#ifdef USB_ENABLE_SERIAL
|
#ifdef USB_ENABLE_SERIAL
|
||||||
|
|
14
tools/configure
vendored
14
tools/configure
vendored
|
@ -16,6 +16,7 @@ GLOBAL_LDOPTS=""
|
||||||
extradefines=""
|
extradefines=""
|
||||||
use_logf="#undef ROCKBOX_HAS_LOGF"
|
use_logf="#undef ROCKBOX_HAS_LOGF"
|
||||||
use_bootchart="#undef DO_BOOTCHART"
|
use_bootchart="#undef DO_BOOTCHART"
|
||||||
|
use_logf_serial="#undef LOGF_SERIAL"
|
||||||
|
|
||||||
scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
|
scriptver=`echo '$Revision$' | sed -e 's:\\$::g' -e 's/Revision: //'`
|
||||||
|
|
||||||
|
@ -715,7 +716,7 @@ whichadvanced () {
|
||||||
echo ""
|
echo ""
|
||||||
printf "Enter your developer options (press only enter when done)\n\
|
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\
|
(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
|
if [ "$modelname" = "archosplayer" ]; then
|
||||||
printf ", Use (A)TA poweroff"
|
printf ", Use (A)TA poweroff"
|
||||||
fi
|
fi
|
||||||
|
@ -766,6 +767,11 @@ whichadvanced () {
|
||||||
bootchart="yes"
|
bootchart="yes"
|
||||||
logf="yes"
|
logf="yes"
|
||||||
;;
|
;;
|
||||||
|
[Ii])
|
||||||
|
echo "Logf to serial port enabled (logf also enabled)"
|
||||||
|
logf="yes"
|
||||||
|
logf_serial="yes"
|
||||||
|
;;
|
||||||
[Ss])
|
[Ss])
|
||||||
echo "Simulator build enabled"
|
echo "Simulator build enabled"
|
||||||
simulator="yes"
|
simulator="yes"
|
||||||
|
@ -845,6 +851,9 @@ whichadvanced () {
|
||||||
if [ "yes" = "$logf" ]; then
|
if [ "yes" = "$logf" ]; then
|
||||||
use_logf="#define ROCKBOX_HAS_LOGF 1"
|
use_logf="#define ROCKBOX_HAS_LOGF 1"
|
||||||
fi
|
fi
|
||||||
|
if [ "yes" = "$logf_serial" ]; then
|
||||||
|
use_logf_serial="#define LOGF_SERIAL 1"
|
||||||
|
fi
|
||||||
if [ "yes" = "$bootchart" ]; then
|
if [ "yes" = "$bootchart" ]; then
|
||||||
use_bootchart="#define DO_BOOTCHART 1"
|
use_bootchart="#define DO_BOOTCHART 1"
|
||||||
fi
|
fi
|
||||||
|
@ -3707,6 +3716,9 @@ cat > autoconf.h <<EOF
|
||||||
/* Define this if you build rockbox to support the logf logging and display */
|
/* Define this if you build rockbox to support the logf logging and display */
|
||||||
${use_logf}
|
${use_logf}
|
||||||
|
|
||||||
|
/* Define this if you want logf to output to the serial port */
|
||||||
|
${use_logf_serial}
|
||||||
|
|
||||||
/* Define this to record a chart with timings for the stages of boot */
|
/* Define this to record a chart with timings for the stages of boot */
|
||||||
${use_bootchart}
|
${use_bootchart}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue