forked from len0rd/rockbox
(Optional) logf support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6538 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c3b1eceff1
commit
edc07922eb
9 changed files with 103 additions and 39 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
logfdisp.c
|
||||||
alarm_menu.c
|
alarm_menu.c
|
||||||
bookmark.c
|
bookmark.c
|
||||||
credits.c
|
credits.c
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
#include "ata_mmc.h"
|
#include "ata_mmc.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "logfdisp.h"
|
||||||
|
|
||||||
#ifdef IRIVER_H100
|
#ifdef IRIVER_H100
|
||||||
#include "uda1380.h"
|
#include "uda1380.h"
|
||||||
|
|
@ -2046,6 +2047,9 @@ bool debug_menu(void)
|
||||||
{ "View runtime", view_runtime },
|
{ "View runtime", view_runtime },
|
||||||
#ifdef CONFIG_TUNER
|
#ifdef CONFIG_TUNER
|
||||||
{ "FM Radio", dbg_fm_radio },
|
{ "FM Radio", dbg_fm_radio },
|
||||||
|
#endif
|
||||||
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
|
{"logf", logfdisplay },
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
#include <timefuncs.h>
|
#include <timefuncs.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
|
|
@ -74,4 +76,13 @@ bool logfdisplay(void)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#else /* HAVE_LCD_BITMAP */
|
||||||
|
bool logfdisplay(void)
|
||||||
|
|
||||||
|
{
|
||||||
|
/* TODO: implement a browser for charcell bitmaps */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
|
#endif /* ROCKBOX_HAS_LOGF */
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifndef LOGFDISP_H
|
||||||
|
#define LOGFDISP_H
|
||||||
bool logfdisplay(void);
|
bool logfdisplay(void);
|
||||||
#endif
|
|
||||||
|
#endif /* LOGFDISP_H */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
#include "logfdisp.h"
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
#include "recording.h"
|
#include "recording.h"
|
||||||
|
|
@ -80,25 +81,8 @@ int show_logo( void )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
lcd_remote_bitmap(rockbox112x37,10,14,112,37, false);
|
lcd_remote_clear_display();
|
||||||
#endif
|
lcd_remote_bitmap(rockbox112x37,10,14,112,37, false);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/*
|
|
||||||
* This code is not used anymore, but I kept it here since it shows
|
|
||||||
* one way of using the BMP reader function to display an externally
|
|
||||||
* providing logo.
|
|
||||||
*/
|
|
||||||
unsigned char buffer[112 * 8];
|
|
||||||
int width, height;
|
|
||||||
|
|
||||||
int failure;
|
|
||||||
failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer);
|
|
||||||
|
|
||||||
debugf("read_bmp_file() returned %d, width %d height %d\n",
|
|
||||||
failure, width, height);
|
|
||||||
|
|
||||||
lcd_bitmap(&buffer, 0, 10, width, height, false);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snprintf(version, sizeof(version), "Ver. %s", appsversion);
|
snprintf(version, sizeof(version), "Ver. %s", appsversion);
|
||||||
|
|
@ -365,6 +349,9 @@ bool info_menu(void)
|
||||||
{ ID2P(LANG_DEBUG), debug_menu },
|
{ ID2P(LANG_DEBUG), debug_menu },
|
||||||
#else
|
#else
|
||||||
{ ID2P(LANG_USB), simulate_usb },
|
{ ID2P(LANG_USB), simulate_usb },
|
||||||
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
|
{"logf", logfdisplay },
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
logf.c
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
backlight.c
|
backlight.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#ifndef LOGF_H
|
#ifndef LOGF_H
|
||||||
#define LOGF_H
|
#define LOGF_H
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
|
|
||||||
#define MAX_LOGF_LINES 1000
|
#define MAX_LOGF_LINES 1000
|
||||||
#define MAX_LOGF_DATASIZE (16*MAX_LOGF_LINES)
|
#define MAX_LOGF_DATASIZE (16*MAX_LOGF_LINES)
|
||||||
|
|
@ -27,5 +30,9 @@ extern int logfindex;
|
||||||
extern bool logfwrap;
|
extern bool logfwrap;
|
||||||
|
|
||||||
void logf(const char *format, ...);
|
void logf(const char *format, ...);
|
||||||
|
#else
|
||||||
|
/* built without logf() support enabled */
|
||||||
|
#define logf(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LOGF_H */
|
#endif /* LOGF_H */
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#include "logf.h"
|
#include "logf.h"
|
||||||
|
|
||||||
|
/* Only provide all this if asked to */
|
||||||
|
#ifdef ROCKBOX_HAS_LOGF
|
||||||
|
|
||||||
unsigned char logfbuffer[MAX_LOGF_LINES][16];
|
unsigned char logfbuffer[MAX_LOGF_LINES][16];
|
||||||
int logfindex;
|
int logfindex;
|
||||||
bool logfwrap;
|
bool logfwrap;
|
||||||
|
|
@ -96,3 +99,5 @@ void logf(const char *format, ...)
|
||||||
|
|
||||||
displayremote();
|
displayremote();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
||||||
79
tools/configure
vendored
79
tools/configure
vendored
|
|
@ -11,6 +11,8 @@
|
||||||
# global CC options for all platforms
|
# global CC options for all platforms
|
||||||
CCOPTS="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes"
|
CCOPTS="-W -Wall -O -nostdlib -ffreestanding -Wstrict-prototypes"
|
||||||
|
|
||||||
|
use_logf="#undef ROCKBOX_HAS_LOGF"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Begin Function Definitions
|
# Begin Function Definitions
|
||||||
#
|
#
|
||||||
|
|
@ -171,6 +173,48 @@ whichaddr () {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
whichdevel () {
|
||||||
|
##################################################################
|
||||||
|
# Prompt for specific developer options
|
||||||
|
#
|
||||||
|
echo ""
|
||||||
|
echo "Enter your developer options (press enter when done)"
|
||||||
|
echo "(D)EBUG, (L)ogf, (S)imulator"
|
||||||
|
cont=1
|
||||||
|
|
||||||
|
while [ $cont = "1" ]; do
|
||||||
|
|
||||||
|
option=`input`;
|
||||||
|
|
||||||
|
case $option in
|
||||||
|
[Dd])
|
||||||
|
echo "define DEBUG"
|
||||||
|
debug="1"
|
||||||
|
GCCOPTS="$GCCOPTS -g -DDEBUG"
|
||||||
|
;;
|
||||||
|
[Ll])
|
||||||
|
logf="yes"
|
||||||
|
echo "logf() support enabled"
|
||||||
|
use_logf="#define ROCKBOX_HAS_LOGF 1"
|
||||||
|
;;
|
||||||
|
[Ss])
|
||||||
|
echo "Simulator build enabled"
|
||||||
|
simulator="yes"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "done"
|
||||||
|
cont=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "yes" = "$simulator" ]; then
|
||||||
|
debug="1"
|
||||||
|
extradefines="-DSIMULATOR"
|
||||||
|
whichsim
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
whichsim () {
|
whichsim () {
|
||||||
|
|
||||||
if [ -z "$simver" ]; then
|
if [ -z "$simver" ]; then
|
||||||
|
|
@ -230,9 +274,6 @@ whichlang() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
target=$1
|
|
||||||
debug=$2
|
|
||||||
|
|
||||||
if test "$1" = "--help"; then
|
if test "$1" = "--help"; then
|
||||||
echo "Rockbox configure script."
|
echo "Rockbox configure script."
|
||||||
echo "Invoke this in a directory to generate a Makefile to build Rockbox"
|
echo "Invoke this in a directory to generate a Makefile to build Rockbox"
|
||||||
|
|
@ -318,8 +359,6 @@ fi
|
||||||
apps="apps"
|
apps="apps"
|
||||||
appsdir='\$(ROOTDIR)/apps'
|
appsdir='\$(ROOTDIR)/apps'
|
||||||
|
|
||||||
if [ -z "$archos" ]; then
|
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# Figure out target platform
|
# Figure out target platform
|
||||||
#
|
#
|
||||||
|
|
@ -469,7 +508,10 @@ if [ -z "$archos" ]; then
|
||||||
|
|
||||||
echo "Platform set to $archos"
|
echo "Platform set to $archos"
|
||||||
|
|
||||||
fi
|
|
||||||
|
############################################################################
|
||||||
|
# Amount of memory, for those that can differ.
|
||||||
|
#
|
||||||
|
|
||||||
if [ -z "$memory" ]; then
|
if [ -z "$memory" ]; then
|
||||||
size="2"
|
size="2"
|
||||||
|
|
@ -490,11 +532,11 @@ if [ -z "$memory" ]; then
|
||||||
echo "Memory size selected: $memory MB"
|
echo "Memory size selected: $memory MB"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$debug" ]; then
|
##################################################################
|
||||||
##################################################################
|
# Figure out build "type"
|
||||||
# Figure out debug on/off
|
#
|
||||||
#
|
echo ""
|
||||||
echo "Build (N)ormal, (D)ebug, (S)imulator, (B)ootloader? (N)"
|
echo "Build (N)ormal, (D)evel, (S)imulator, (B)ootloader? (N)"
|
||||||
|
|
||||||
option=`input`;
|
option=`input`;
|
||||||
|
|
||||||
|
|
@ -518,9 +560,8 @@ if [ -z "$debug" ]; then
|
||||||
whichsim
|
whichsim
|
||||||
;;
|
;;
|
||||||
[Dd])
|
[Dd])
|
||||||
debug="1"
|
echo "Devel build selected"
|
||||||
echo "Debug build selected"
|
whichdevel
|
||||||
GCCOPTS="$GCCOPTS -g -DDEBUG"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
debug=""
|
debug=""
|
||||||
|
|
@ -529,11 +570,12 @@ if [ -z "$debug" ]; then
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
whichaddr
|
whichaddr
|
||||||
|
|
||||||
if [ -z "$language" ]; then
|
############################################################################
|
||||||
|
# language
|
||||||
|
|
||||||
echo "Select a number for the language to use (default is english)"
|
echo "Select a number for the language to use (default is english)"
|
||||||
|
|
||||||
|
|
@ -545,7 +587,6 @@ if [ -z "$language" ]; then
|
||||||
language="english"
|
language="english"
|
||||||
fi
|
fi
|
||||||
echo "Language set to $language"
|
echo "Language set to $language"
|
||||||
fi
|
|
||||||
|
|
||||||
uname=`uname`
|
uname=`uname`
|
||||||
|
|
||||||
|
|
@ -594,6 +635,7 @@ fi
|
||||||
|
|
||||||
sed > autoconf.h \
|
sed > autoconf.h \
|
||||||
-e "s,@ENDIAN@,${defendian},g" \
|
-e "s,@ENDIAN@,${defendian},g" \
|
||||||
|
-e "s,^#undef ROCKBOX_HAS_LOGF,$use_logf,g" \
|
||||||
<<EOF
|
<<EOF
|
||||||
/* This header was made by configure */
|
/* This header was made by configure */
|
||||||
#ifndef __BUILD_AUTOCONF_H
|
#ifndef __BUILD_AUTOCONF_H
|
||||||
|
|
@ -602,6 +644,9 @@ sed > autoconf.h \
|
||||||
/* Define endianess for the target or simulator platform */
|
/* Define endianess for the target or simulator platform */
|
||||||
#define @ENDIAN@ 1
|
#define @ENDIAN@ 1
|
||||||
|
|
||||||
|
/* Define this if you build rockbox to support the logf logging and display */
|
||||||
|
#undef ROCKBOX_HAS_LOGF
|
||||||
|
|
||||||
#endif /* __BUILD_AUTOCONF_H */
|
#endif /* __BUILD_AUTOCONF_H */
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue