forked from len0rd/rockbox
Major cleanup of checkwps - fix all warnings and add a script to build versions for all supported targets (plus some unsupported ones). You now need to run the version of checkwps that matches the device your WPS is for.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16831 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d75bb78fda
commit
78d29f535f
16 changed files with 133 additions and 24 deletions
|
@ -53,6 +53,7 @@
|
||||||
#include "dsp.h"
|
#include "dsp.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "cuesheet.h"
|
#include "cuesheet.h"
|
||||||
|
#include "playlist.h"
|
||||||
|
|
||||||
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
|
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "id3.h"
|
#include "id3.h"
|
||||||
#include "playlist.h"
|
|
||||||
|
|
||||||
/* constants used in line_type and as refresh_mode for wps_refresh */
|
/* constants used in line_type and as refresh_mode for wps_refresh */
|
||||||
#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */
|
#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "gwps.h"
|
#include "gwps.h"
|
||||||
|
#include "file.h"
|
||||||
|
#include "misc.h"
|
||||||
#ifdef __PCTOOL__
|
#ifdef __PCTOOL__
|
||||||
#define DEBUGF printf
|
#define DEBUGF printf
|
||||||
#define FONT_SYSFIXED 0
|
#define FONT_SYSFIXED 0
|
||||||
|
@ -39,7 +41,6 @@
|
||||||
#include "atoi.h"
|
#include "atoi.h"
|
||||||
#include "gwps.h"
|
#include "gwps.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "misc.h"
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
12
apps/misc.c
12
apps/misc.c
|
@ -18,14 +18,16 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "config.h"
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "file.h"
|
||||||
|
#ifdef __PCTOOL__
|
||||||
|
#include <stdarg.h>
|
||||||
|
#else
|
||||||
#include "sprintf.h"
|
#include "sprintf.h"
|
||||||
#ifndef __PCTOOL__
|
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "config.h"
|
|
||||||
#include "file.h"
|
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
#include "lcd.h"
|
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#include "errno.h"
|
#include "errno.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
@ -49,7 +51,6 @@
|
||||||
#include "tagcache.h"
|
#include "tagcache.h"
|
||||||
#include "scrobbler.h"
|
#include "scrobbler.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
#include "ata_mmc.h"
|
#include "ata_mmc.h"
|
||||||
|
@ -77,7 +78,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __PCTOOL__
|
|
||||||
/* Format a large-range value for output, using the appropriate unit so that
|
/* Format a large-range value for output, using the appropriate unit so that
|
||||||
* the displayed value is in the range 1 <= display < 1000 (1024 for "binary"
|
* the displayed value is in the range 1 <= display < 1000 (1024 for "binary"
|
||||||
* units) if possible, and 3 significant digits are shown. If a buffer is
|
* units) if possible, and 3 significant digits are shown. If a buffer is
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
#include "inttypes.h"
|
#include "inttypes.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
#include "file.h"
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
#include "lcd-remote.h"
|
#include "lcd-remote.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef __PCTOOL__
|
#ifndef __PCTOOL__
|
||||||
#include "file.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include "gwps-common.h"
|
#include "gwps-common.h"
|
||||||
#include "bookmark.h"
|
#include "bookmark.h"
|
||||||
|
#include "playlist.h"
|
||||||
#include "tagtree.h"
|
#include "tagtree.h"
|
||||||
#include "menus/exported_menus.h"
|
#include "menus/exported_menus.h"
|
||||||
#ifdef HAVE_RTC_ALARM
|
#ifdef HAVE_RTC_ALARM
|
||||||
|
|
|
@ -22,7 +22,9 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#ifndef __PCTOOL__
|
||||||
#include "button-target.h"
|
#include "button-target.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern struct event_queue button_queue;
|
extern struct event_queue button_queue;
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,11 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "adc.h"
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
|
|
||||||
#if defined(TARGET_TREE)
|
#if defined(TARGET_TREE) && !defined(__PCTOOL__)
|
||||||
#include "lcd-remote-target.h"
|
#include "lcd-remote-target.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "audio.h"
|
#include "audio.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
#include "adc.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,25 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
all: checkwps
|
ROOT=../..
|
||||||
|
|
||||||
checkwps: checkwps.c ../../apps/gui/wps_parser.c ../../apps/gui/wps_debug.c ../../firmware/common/ctype.c ../../apps/misc.c ../../apps/recorder/bmp.c
|
COMMON=$(ROOT)/apps/gui/wps_parser.c \
|
||||||
$(SILENT)$(CC) -g -I ../../apps/gui -I../../firmware/export \
|
$(ROOT)/apps/gui/wps_debug.c \
|
||||||
-D__PCTOOL__ -DDEBUG -DROCKBOX_HAS_LOGF -DIPOD_COLOR -D ROCKBOX_DIR_LEN -D WPS_DIR=\".\" \
|
$(ROOT)/apps/misc.c \
|
||||||
-I../../apps -I../../firmware/target/arm/ipod -I../../firmware/include $+ -o $@
|
$(ROOT)/apps/recorder/bmp.c
|
||||||
|
|
||||||
|
INCLUDE=-I $(ROOT)/apps/gui \
|
||||||
|
-I $(ROOT)/firmware/export \
|
||||||
|
-I $(ROOT)/apps \
|
||||||
|
-I .
|
||||||
|
|
||||||
|
CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\"
|
||||||
|
|
||||||
|
all: checkwps.$(MODEL)
|
||||||
|
|
||||||
|
checkwps.$(MODEL): checkwps.c $(COMMON)
|
||||||
|
@echo CC [$(TARGET)]
|
||||||
|
@$(CC) $(INCLUDE) $(CFLAGS) $(COMMON) -D$(TARGET) checkwps.c -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f cleanwps
|
rm -f checkwps.$(MODEL)
|
||||||
|
|
23
tools/checkwps/README
Normal file
23
tools/checkwps/README
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
This directory contains the checkwps tool which can be used to
|
||||||
|
validate wps files outside of Rockbox.
|
||||||
|
|
||||||
|
checkwps uses the Rockbox WPS parser and is therefore built in
|
||||||
|
target-specific versions (to avoid making lots of changes to the core
|
||||||
|
code).
|
||||||
|
|
||||||
|
To compile
|
||||||
|
----------
|
||||||
|
|
||||||
|
Just run the ./buildall.sh script
|
||||||
|
|
||||||
|
|
||||||
|
To remove all compiled files
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
./cleanall.sh
|
||||||
|
|
||||||
|
|
||||||
|
To add a new target
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Add $target and $modelname from tools/configure to targets.txt
|
8
tools/checkwps/buildall.sh
Executable file
8
tools/checkwps/buildall.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
cat targets.txt | (
|
||||||
|
while read target model
|
||||||
|
do
|
||||||
|
rm -f checkwps.$model
|
||||||
|
make MODEL=$model TARGET=$target
|
||||||
|
done
|
||||||
|
)
|
|
@ -1,5 +1,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include "config.h"
|
||||||
#include "gwps.h"
|
#include "gwps.h"
|
||||||
|
|
||||||
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
||||||
|
@ -20,7 +22,7 @@ int errno;
|
||||||
unsigned short letoh16(unsigned short x)
|
unsigned short letoh16(unsigned short x)
|
||||||
{
|
{
|
||||||
unsigned short n = 0x1234;
|
unsigned short n = 0x1234;
|
||||||
unsigned char* ch = &n;
|
unsigned char* ch = (unsigned char*)&n;
|
||||||
|
|
||||||
if (*ch == 0x34)
|
if (*ch == 0x34)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +36,7 @@ unsigned short letoh16(unsigned short x)
|
||||||
unsigned int htole32(unsigned int x)
|
unsigned int htole32(unsigned int x)
|
||||||
{
|
{
|
||||||
unsigned short n = 0x1234;
|
unsigned short n = 0x1234;
|
||||||
unsigned char* ch = &n;
|
unsigned char* ch = (unsigned char*)&n;
|
||||||
|
|
||||||
if (*ch == 0x34)
|
if (*ch == 0x34)
|
||||||
{
|
{
|
||||||
|
@ -80,6 +82,11 @@ bool load_wps_backdrop(char* filename)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool load_remote_wps_backdrop(char* filename)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static char pluginbuf[PLUGIN_BUFFER_SIZE];
|
static char pluginbuf[PLUGIN_BUFFER_SIZE];
|
||||||
|
|
||||||
static int dummy_func1(void)
|
static int dummy_func1(void)
|
||||||
|
@ -105,12 +112,17 @@ struct screen screens[NB_SCREENS] =
|
||||||
.width=LCD_WIDTH,
|
.width=LCD_WIDTH,
|
||||||
.height=LCD_HEIGHT,
|
.height=LCD_HEIGHT,
|
||||||
.depth=LCD_DEPTH,
|
.depth=LCD_DEPTH,
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
.is_color=true,
|
.is_color=true,
|
||||||
.has_disk_led=false,
|
#else
|
||||||
|
.is_color=false,
|
||||||
|
#endif
|
||||||
.getxmargin=dummy_func1,
|
.getxmargin=dummy_func1,
|
||||||
.getymargin=dummy_func1,
|
.getymargin=dummy_func1,
|
||||||
|
#if LCD_DEPTH > 1
|
||||||
.get_foreground=dummy_func2,
|
.get_foreground=dummy_func2,
|
||||||
.get_background=dummy_func2,
|
.get_background=dummy_func2,
|
||||||
|
#endif
|
||||||
},
|
},
|
||||||
#ifdef HAVE_REMOTE_LCD
|
#ifdef HAVE_REMOTE_LCD
|
||||||
{
|
{
|
||||||
|
@ -119,10 +131,12 @@ struct screen screens[NB_SCREENS] =
|
||||||
.height=LCD_REMOTE_HEIGHT,
|
.height=LCD_REMOTE_HEIGHT,
|
||||||
.depth=LCD_REMOTE_DEPTH,
|
.depth=LCD_REMOTE_DEPTH,
|
||||||
.is_color=false,/* No color remotes yet */
|
.is_color=false,/* No color remotes yet */
|
||||||
.getxmargin=dummy_func,
|
.getxmargin=dummy_func1,
|
||||||
.getymargin=dummy_func,
|
.getymargin=dummy_func1,
|
||||||
.get_foreground=dummy_func,
|
#if LCD_REMOTE_DEPTH > 1
|
||||||
.get_background=dummy_func,
|
.get_foreground=dummy_func2,
|
||||||
|
.get_background=dummy_func2,
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
7
tools/checkwps/cleanall.sh
Executable file
7
tools/checkwps/cleanall.sh
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
cat targets.txt | (
|
||||||
|
while read target model
|
||||||
|
do
|
||||||
|
rm -f checkwps.$model
|
||||||
|
done
|
||||||
|
)
|
7
tools/checkwps/file.h
Normal file
7
tools/checkwps/file.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#ifndef MAX_PATH
|
||||||
|
#define MAX_PATH 260
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Wrapper - required for O_RDONLY */
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
33
tools/checkwps/targets.txt
Normal file
33
tools/checkwps/targets.txt
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
ARCHOS_RECORDER recorder
|
||||||
|
ARCHOS_FMRECORDER fmrecorder
|
||||||
|
ARCHOS_RECORDERV2 recorderv2
|
||||||
|
ARCHOS_ONDIOSP ondiosp
|
||||||
|
ARCHOS_ONDIOFM ondiofm
|
||||||
|
IRIVER_H120 h120
|
||||||
|
IRIVER_H300 h300
|
||||||
|
IRIVER_H100 h100
|
||||||
|
IRIVER_IFP7XX ifp7xx
|
||||||
|
IRIVER_H10 h10
|
||||||
|
IRIVER_H10_5GB h10_5gb
|
||||||
|
IPOD_COLOR ipodcolor
|
||||||
|
IPOD_NANO ipodnano
|
||||||
|
IPOD_VIDEO ipodvideo
|
||||||
|
IPOD_3G ipod3g
|
||||||
|
IPOD_4G ipod4g
|
||||||
|
IPOD_MINI ipodmini
|
||||||
|
IPOD_MINI2G ipodmini2g
|
||||||
|
IPOD_1G2G ipod1g2g
|
||||||
|
IAUDIO_X5 x5
|
||||||
|
IAUDIO_M5 m5
|
||||||
|
COWON_D2 cowond2
|
||||||
|
IAUDIO_M3 m3
|
||||||
|
GIGABEAT_F gigabeatf
|
||||||
|
GIGABEAT_S gigabeats
|
||||||
|
MROBE_500 mrobe500
|
||||||
|
MROBE_100 mrobe100
|
||||||
|
LOGIK_DAX logikdax
|
||||||
|
CREATIVE_ZVM creativezvm
|
||||||
|
SANSA_E200 e200
|
||||||
|
SANSA_E200 e200r
|
||||||
|
SANSA_C200 c200
|
||||||
|
ELIO_TPJ1022 tpj1022
|
Loading…
Add table
Add a link
Reference in a new issue