remove compiler warnings by using '#ifdef DEBUG' on a large section
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@859 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cccf7f8bb1
commit
7e8615757c
1 changed files with 9 additions and 1 deletions
|
@ -22,8 +22,10 @@
|
|||
#include <stdarg.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
static char debugmembuf[100];
|
||||
static char debugbuf[200];
|
||||
#endif
|
||||
|
||||
#ifndef SIMULATOR /* allow non archos platforms to display output */
|
||||
|
||||
|
@ -39,6 +41,7 @@ void debug_init(void)
|
|||
IPRE |= 0xf000; /* Set to highest priority */
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static int debug_tx_ready(void)
|
||||
{
|
||||
return (SSR1 & SCI_TDRE);
|
||||
|
@ -60,6 +63,7 @@ static void debug_tx_char(char ch)
|
|||
|
||||
static void debug_handle_error(char ssr)
|
||||
{
|
||||
(void)ssr;
|
||||
SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
|
||||
}
|
||||
|
||||
|
@ -163,6 +167,7 @@ static void putpacket (char *buffer)
|
|||
SCR1 |= 0x40;
|
||||
}
|
||||
|
||||
|
||||
/* convert the memory, pointed to by mem into hex, placing result in buf */
|
||||
/* return a pointer to the last char put in buf (null) */
|
||||
static char *mem2hex (char *mem, char *buf, int count)
|
||||
|
@ -186,6 +191,7 @@ static void debug(char *msg)
|
|||
mem2hex(msg, &debugbuf[1], strlen(msg));
|
||||
putpacket(debugbuf);
|
||||
}
|
||||
#endif /* end of DEBUG section */
|
||||
|
||||
void debugf(char *fmt, ...)
|
||||
{
|
||||
|
@ -196,6 +202,8 @@ void debugf(char *fmt, ...)
|
|||
vsnprintf(debugmembuf, sizeof(debugmembuf), fmt, ap);
|
||||
va_end(ap);
|
||||
debug(debugmembuf);
|
||||
#else
|
||||
(void)fmt;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue