summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps-common.c1
-rw-r--r--apps/gui/gwps.h1
-rw-r--r--apps/gui/wps_parser.c3
-rw-r--r--apps/misc.c12
-rw-r--r--apps/recorder/bmp.c2
-rw-r--r--apps/root_menu.c1
-rw-r--r--firmware/export/button.h2
-rw-r--r--firmware/export/lcd-remote.h3
-rw-r--r--firmware/rolo.c1
-rw-r--r--tools/checkwps/Makefile25
-rw-r--r--tools/checkwps/README23
-rwxr-xr-xtools/checkwps/buildall.sh8
-rw-r--r--tools/checkwps/checkwps.c28
-rwxr-xr-xtools/checkwps/cleanall.sh7
-rw-r--r--tools/checkwps/file.h7
-rw-r--r--tools/checkwps/targets.txt33
16 files changed, 133 insertions, 24 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 37b2b7c5d1..a6bb917a5a 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -53,6 +53,7 @@
53#include "dsp.h" 53#include "dsp.h"
54#include "action.h" 54#include "action.h"
55#include "cuesheet.h" 55#include "cuesheet.h"
56#include "playlist.h"
56 57
57#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) 58#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
58#include "backdrop.h" 59#include "backdrop.h"
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index b24c243cd7..127fd99511 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -22,7 +22,6 @@
22#include "screen_access.h" 22#include "screen_access.h"
23#include "statusbar.h" 23#include "statusbar.h"
24#include "id3.h" 24#include "id3.h"
25#include "playlist.h"
26 25
27/* constants used in line_type and as refresh_mode for wps_refresh */ 26/* constants used in line_type and as refresh_mode for wps_refresh */
28#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */ 27#define WPS_REFRESH_STATIC 1 /* line doesn't change over time */
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index e8c3c9f629..9bbdb2e5d0 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -20,6 +20,8 @@
20#include <stdio.h> 20#include <stdio.h>
21#include <string.h> 21#include <string.h>
22#include "gwps.h" 22#include "gwps.h"
23#include "file.h"
24#include "misc.h"
23#ifdef __PCTOOL__ 25#ifdef __PCTOOL__
24#define DEBUGF printf 26#define DEBUGF printf
25#define FONT_SYSFIXED 0 27#define FONT_SYSFIXED 0
@@ -39,7 +41,6 @@
39#include "atoi.h" 41#include "atoi.h"
40#include "gwps.h" 42#include "gwps.h"
41#include "settings.h" 43#include "settings.h"
42#include "misc.h"
43#include "plugin.h" 44#include "plugin.h"
44 45
45#ifdef HAVE_LCD_BITMAP 46#ifdef HAVE_LCD_BITMAP
diff --git a/apps/misc.c b/apps/misc.c
index 1ce65c0108..1d83640dc4 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -18,14 +18,16 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include <stdlib.h> 19#include <stdlib.h>
20#include <ctype.h> 20#include <ctype.h>
21#include "config.h"
22#include "lcd.h"
23#include "file.h"
24#ifdef __PCTOOL__
25#include <stdarg.h>
26#else
21#include "sprintf.h" 27#include "sprintf.h"
22#ifndef __PCTOOL__
23#include "lang.h" 28#include "lang.h"
24#include "string.h" 29#include "string.h"
25#include "config.h"
26#include "file.h"
27#include "dir.h" 30#include "dir.h"
28#include "lcd.h"
29#include "lcd-remote.h" 31#include "lcd-remote.h"
30#include "errno.h" 32#include "errno.h"
31#include "system.h" 33#include "system.h"
@@ -49,7 +51,6 @@
49#include "tagcache.h" 51#include "tagcache.h"
50#include "scrobbler.h" 52#include "scrobbler.h"
51#include "sound.h" 53#include "sound.h"
52#endif
53 54
54#ifdef HAVE_MMC 55#ifdef HAVE_MMC
55#include "ata_mmc.h" 56#include "ata_mmc.h"
@@ -77,7 +78,6 @@
77#endif 78#endif
78#endif 79#endif
79 80
80#ifndef __PCTOOL__
81/* Format a large-range value for output, using the appropriate unit so that 81/* Format a large-range value for output, using the appropriate unit so that
82 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" 82 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary"
83 * units) if possible, and 3 significant digits are shown. If a buffer is 83 * units) if possible, and 3 significant digits are shown. If a buffer is
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index f844c8908f..e2d5713aa5 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -35,11 +35,11 @@
35#include "inttypes.h" 35#include "inttypes.h"
36#include "debug.h" 36#include "debug.h"
37#include "lcd.h" 37#include "lcd.h"
38#include "file.h"
38#ifdef HAVE_REMOTE_LCD 39#ifdef HAVE_REMOTE_LCD
39#include "lcd-remote.h" 40#include "lcd-remote.h"
40#endif 41#endif
41#ifndef __PCTOOL__ 42#ifndef __PCTOOL__
42#include "file.h"
43#include "config.h" 43#include "config.h"
44#include "system.h" 44#include "system.h"
45#include "bmp.h" 45#include "bmp.h"
diff --git a/apps/root_menu.c b/apps/root_menu.c
index ae7f92fc9b..281a528574 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -59,6 +59,7 @@
59#endif 59#endif
60#include "gwps-common.h" 60#include "gwps-common.h"
61#include "bookmark.h" 61#include "bookmark.h"
62#include "playlist.h"
62#include "tagtree.h" 63#include "tagtree.h"
63#include "menus/exported_menus.h" 64#include "menus/exported_menus.h"
64#ifdef HAVE_RTC_ALARM 65#ifdef HAVE_RTC_ALARM
diff --git a/firmware/export/button.h b/firmware/export/button.h
index f50f3dd9a4..95da7adc42 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -22,7 +22,9 @@
22#include <stdbool.h> 22#include <stdbool.h>
23#include <inttypes.h> 23#include <inttypes.h>
24#include "config.h" 24#include "config.h"
25#ifndef __PCTOOL__
25#include "button-target.h" 26#include "button-target.h"
27#endif
26 28
27extern struct event_queue button_queue; 29extern struct event_queue button_queue;
28 30
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index b046c0736d..55d3f6fb38 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -23,12 +23,11 @@
23#include <stdbool.h> 23#include <stdbool.h>
24#include "cpu.h" 24#include "cpu.h"
25#include "config.h" 25#include "config.h"
26#include "adc.h"
27#include "lcd.h" 26#include "lcd.h"
28 27
29#ifdef HAVE_REMOTE_LCD 28#ifdef HAVE_REMOTE_LCD
30 29
31#if defined(TARGET_TREE) 30#if defined(TARGET_TREE) && !defined(__PCTOOL__)
32#include "lcd-remote-target.h" 31#include "lcd-remote-target.h"
33#endif 32#endif
34 33
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 30eba91316..bfc0c13ff7 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -28,6 +28,7 @@
28#include "audio.h" 28#include "audio.h"
29#include "system.h" 29#include "system.h"
30#include "i2c.h" 30#include "i2c.h"
31#include "adc.h"
31#include "string.h" 32#include "string.h"
32#include "buffer.h" 33#include "buffer.h"
33 34
diff --git a/tools/checkwps/Makefile b/tools/checkwps/Makefile
index 70b6e0a963..069b1e4334 100644
--- a/tools/checkwps/Makefile
+++ b/tools/checkwps/Makefile
@@ -7,12 +7,25 @@
7# $Id$ 7# $Id$
8# 8#
9 9
10all: checkwps 10ROOT=../..
11 11
12checkwps: checkwps.c ../../apps/gui/wps_parser.c ../../apps/gui/wps_debug.c ../../firmware/common/ctype.c ../../apps/misc.c ../../apps/recorder/bmp.c 12COMMON=$(ROOT)/apps/gui/wps_parser.c \
13 $(SILENT)$(CC) -g -I ../../apps/gui -I../../firmware/export \ 13 $(ROOT)/apps/gui/wps_debug.c \
14-D__PCTOOL__ -DDEBUG -DROCKBOX_HAS_LOGF -DIPOD_COLOR -D ROCKBOX_DIR_LEN -D WPS_DIR=\".\" \ 14 $(ROOT)/apps/misc.c \
15-I../../apps -I../../firmware/target/arm/ipod -I../../firmware/include $+ -o $@ 15 $(ROOT)/apps/recorder/bmp.c
16
17INCLUDE=-I $(ROOT)/apps/gui \
18 -I $(ROOT)/firmware/export \
19 -I $(ROOT)/apps \
20 -I .
21
22CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\"
23
24all: checkwps.$(MODEL)
25
26checkwps.$(MODEL): checkwps.c $(COMMON)
27 @echo CC [$(TARGET)]
28 @$(CC) $(INCLUDE) $(CFLAGS) $(COMMON) -D$(TARGET) checkwps.c -o $@
16 29
17clean: 30clean:
18 rm -f cleanwps 31 rm -f checkwps.$(MODEL)
diff --git a/tools/checkwps/README b/tools/checkwps/README
new file mode 100644
index 0000000000..a94882fdff
--- /dev/null
+++ b/tools/checkwps/README
@@ -0,0 +1,23 @@
1This directory contains the checkwps tool which can be used to
2validate wps files outside of Rockbox.
3
4checkwps uses the Rockbox WPS parser and is therefore built in
5target-specific versions (to avoid making lots of changes to the core
6code).
7
8To compile
9----------
10
11Just run the ./buildall.sh script
12
13
14To remove all compiled files
15----------------------------
16
17./cleanall.sh
18
19
20To add a new target
21-------------------
22
23Add $target and $modelname from tools/configure to targets.txt
diff --git a/tools/checkwps/buildall.sh b/tools/checkwps/buildall.sh
new file mode 100755
index 0000000000..faec663ab8
--- /dev/null
+++ b/tools/checkwps/buildall.sh
@@ -0,0 +1,8 @@
1#!/bin/sh
2cat targets.txt | (
3 while read target model
4 do
5 rm -f checkwps.$model
6 make MODEL=$model TARGET=$target
7 done
8)
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index ddaaf49b73..1051244538 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -1,5 +1,7 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <fcntl.h>
4#include "config.h"
3#include "gwps.h" 5#include "gwps.h"
4 6
5#define MIN(x,y) ((x) > (y) ? (y) : (x)) 7#define MIN(x,y) ((x) > (y) ? (y) : (x))
@@ -20,7 +22,7 @@ int errno;
20unsigned short letoh16(unsigned short x) 22unsigned short letoh16(unsigned short x)
21{ 23{
22 unsigned short n = 0x1234; 24 unsigned short n = 0x1234;
23 unsigned char* ch = &n; 25 unsigned char* ch = (unsigned char*)&n;
24 26
25 if (*ch == 0x34) 27 if (*ch == 0x34)
26 { 28 {
@@ -34,7 +36,7 @@ unsigned short letoh16(unsigned short x)
34unsigned int htole32(unsigned int x) 36unsigned int htole32(unsigned int x)
35{ 37{
36 unsigned short n = 0x1234; 38 unsigned short n = 0x1234;
37 unsigned char* ch = &n; 39 unsigned char* ch = (unsigned char*)&n;
38 40
39 if (*ch == 0x34) 41 if (*ch == 0x34)
40 { 42 {
@@ -80,6 +82,11 @@ bool load_wps_backdrop(char* filename)
80 return true; 82 return true;
81} 83}
82 84
85bool load_remote_wps_backdrop(char* filename)
86{
87 return true;
88}
89
83static char pluginbuf[PLUGIN_BUFFER_SIZE]; 90static char pluginbuf[PLUGIN_BUFFER_SIZE];
84 91
85static int dummy_func1(void) 92static int dummy_func1(void)
@@ -105,12 +112,17 @@ struct screen screens[NB_SCREENS] =
105 .width=LCD_WIDTH, 112 .width=LCD_WIDTH,
106 .height=LCD_HEIGHT, 113 .height=LCD_HEIGHT,
107 .depth=LCD_DEPTH, 114 .depth=LCD_DEPTH,
115#ifdef HAVE_LCD_COLOR
108 .is_color=true, 116 .is_color=true,
109 .has_disk_led=false, 117#else
118 .is_color=false,
119#endif
110 .getxmargin=dummy_func1, 120 .getxmargin=dummy_func1,
111 .getymargin=dummy_func1, 121 .getymargin=dummy_func1,
122#if LCD_DEPTH > 1
112 .get_foreground=dummy_func2, 123 .get_foreground=dummy_func2,
113 .get_background=dummy_func2, 124 .get_background=dummy_func2,
125#endif
114 }, 126 },
115#ifdef HAVE_REMOTE_LCD 127#ifdef HAVE_REMOTE_LCD
116 { 128 {
@@ -119,10 +131,12 @@ struct screen screens[NB_SCREENS] =
119 .height=LCD_REMOTE_HEIGHT, 131 .height=LCD_REMOTE_HEIGHT,
120 .depth=LCD_REMOTE_DEPTH, 132 .depth=LCD_REMOTE_DEPTH,
121 .is_color=false,/* No color remotes yet */ 133 .is_color=false,/* No color remotes yet */
122 .getxmargin=dummy_func, 134 .getxmargin=dummy_func1,
123 .getymargin=dummy_func, 135 .getymargin=dummy_func1,
124 .get_foreground=dummy_func, 136#if LCD_REMOTE_DEPTH > 1
125 .get_background=dummy_func, 137 .get_foreground=dummy_func2,
138 .get_background=dummy_func2,
139#endif
126 } 140 }
127#endif 141#endif
128}; 142};
diff --git a/tools/checkwps/cleanall.sh b/tools/checkwps/cleanall.sh
new file mode 100755
index 0000000000..6cd1a90676
--- /dev/null
+++ b/tools/checkwps/cleanall.sh
@@ -0,0 +1,7 @@
1#!/bin/sh
2cat targets.txt | (
3 while read target model
4 do
5 rm -f checkwps.$model
6 done
7)
diff --git a/tools/checkwps/file.h b/tools/checkwps/file.h
new file mode 100644
index 0000000000..4256c1ee37
--- /dev/null
+++ b/tools/checkwps/file.h
@@ -0,0 +1,7 @@
1#ifndef MAX_PATH
2#define MAX_PATH 260
3#endif
4
5/* Wrapper - required for O_RDONLY */
6
7#include <fcntl.h>
diff --git a/tools/checkwps/targets.txt b/tools/checkwps/targets.txt
new file mode 100644
index 0000000000..d2c54378d9
--- /dev/null
+++ b/tools/checkwps/targets.txt
@@ -0,0 +1,33 @@
1ARCHOS_RECORDER recorder
2ARCHOS_FMRECORDER fmrecorder
3ARCHOS_RECORDERV2 recorderv2
4ARCHOS_ONDIOSP ondiosp
5ARCHOS_ONDIOFM ondiofm
6IRIVER_H120 h120
7IRIVER_H300 h300
8IRIVER_H100 h100
9IRIVER_IFP7XX ifp7xx
10IRIVER_H10 h10
11IRIVER_H10_5GB h10_5gb
12IPOD_COLOR ipodcolor
13IPOD_NANO ipodnano
14IPOD_VIDEO ipodvideo
15IPOD_3G ipod3g
16IPOD_4G ipod4g
17IPOD_MINI ipodmini
18IPOD_MINI2G ipodmini2g
19IPOD_1G2G ipod1g2g
20IAUDIO_X5 x5
21IAUDIO_M5 m5
22COWON_D2 cowond2
23IAUDIO_M3 m3
24GIGABEAT_F gigabeatf
25GIGABEAT_S gigabeats
26MROBE_500 mrobe500
27MROBE_100 mrobe100
28LOGIK_DAX logikdax
29CREATIVE_ZVM creativezvm
30SANSA_E200 e200
31SANSA_E200 e200r
32SANSA_C200 c200
33ELIO_TPJ1022 tpj1022