From fb709522283bfb7558bf2b824a4143a919d59e97 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Wed, 24 Oct 2007 22:06:36 +0000 Subject: logf changes: * Disable logf by default and allow per-file enabling with "#define LOGF_ENABLE". To enable globally add that define in the config.h file. * Transform logf calls into DEBUGF calls when ROCKBOX_HAS_LOGF isn't defined, so that they get printed to the console in the sim. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15291 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs.c | 4 +++- apps/playback.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/codecs.c b/apps/codecs.c index 35cce6a861..e41e047720 100644 --- a/apps/codecs.c +++ b/apps/codecs.c @@ -30,7 +30,6 @@ #include "file.h" #include "kernel.h" #include "sprintf.h" -#include "logf.h" #include "screens.h" #include "misc.h" #include "mas.h" @@ -51,6 +50,9 @@ #include "splash.h" #include "general.h" +#define LOGF_ENABLE +#include "logf.h" + #ifdef SIMULATOR #if CONFIG_CODEC == SWCODEC unsigned char codecbuf[CODEC_SIZE]; diff --git a/apps/playback.c b/apps/playback.c index 5443ef5b24..03bbb9ddd2 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -46,7 +46,6 @@ #include "settings.h" #include "codecs.h" #include "audio.h" -#include "logf.h" #include "mp3_playback.h" #include "usb.h" #include "status.h" @@ -98,13 +97,17 @@ * for their correct seeek target, 32k seems a good size */ #define AUDIO_REBUFFER_GUESS_SIZE (1024*32) +/* Define LOGF_ENABLE to enable logf output in this file */ +/*#define LOGF_ENABLE*/ +#include "logf.h" + /* macros to enable logf for queues logging on SYS_TIMEOUT can be disabled */ #ifdef SIMULATOR /* Define this for logf output of all queuing except SYS_TIMEOUT */ #define PLAYBACK_LOGQUEUES /* Define this to logf SYS_TIMEOUT messages */ -#define PLAYBACK_LOGQUEUES_SYS_TIMEOUT +/*#define PLAYBACK_LOGQUEUES_SYS_TIMEOUT*/ #endif #ifdef PLAYBACK_LOGQUEUES @@ -3556,7 +3559,7 @@ static void audio_reset_buffer(void) /* Clear any references to the file buffer */ buffer_state = BUFFER_STATE_INITIALIZED; -#ifdef ROCKBOX_HAS_LOGF +#if defined(ROCKBOX_HAS_LOGF) && defined(LOGF_ENABLE) /* Make sure everything adds up - yes, some info is a bit redundant but aids viewing and the sumation of certain variables should add up to the location of others. */ -- cgit v1.2.3