diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-02-13 19:29:11 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-02-13 19:29:11 +0000 |
commit | efbc61b26f8a297ed278ca981c99debf0bf050c1 (patch) | |
tree | 1f5d795f4c1f901341c6be0211c86e786809f94c /firmware | |
parent | 7ed581627d180907508e842734103d540c736476 (diff) | |
download | rockbox-efbc61b26f8a297ed278ca981c99debf0bf050c1.tar.gz rockbox-efbc61b26f8a297ed278ca981c99debf0bf050c1.zip |
these are now present in export/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3249 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.h | 31 | ||||
-rw-r--r-- | firmware/config-fmrecorder.h | 44 | ||||
-rw-r--r-- | firmware/config-player.h | 33 | ||||
-rw-r--r-- | firmware/config-recorder.h | 38 | ||||
-rw-r--r-- | firmware/config.h | 33 | ||||
-rw-r--r-- | firmware/debug.h | 51 | ||||
-rw-r--r-- | firmware/font.h | 116 | ||||
-rw-r--r-- | firmware/hwcompat.h | 37 | ||||
-rw-r--r-- | firmware/id3.h | 76 | ||||
-rw-r--r-- | firmware/mpeg.h | 116 | ||||
-rw-r--r-- | firmware/panic.h | 25 | ||||
-rw-r--r-- | firmware/powermgmt.h | 101 | ||||
-rw-r--r-- | firmware/rolo.h | 24 | ||||
-rw-r--r-- | firmware/system.h | 267 | ||||
-rw-r--r-- | firmware/thread.h | 30 | ||||
-rw-r--r-- | firmware/usb.h | 31 |
16 files changed, 0 insertions, 1053 deletions
diff --git a/firmware/backlight.h b/firmware/backlight.h deleted file mode 100644 index 09efc45060..0000000000 --- a/firmware/backlight.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef BACKLIGHT_H | ||
20 | #define BACKLIGHT_H | ||
21 | |||
22 | void backlight_init(void); | ||
23 | void backlight_on(void); | ||
24 | void backlight_off(void); | ||
25 | void backlight_tick(void); | ||
26 | int backlight_get_timeout(void); | ||
27 | void backlight_set_timeout(int seconds); | ||
28 | bool backlight_get_on_when_charging(void); | ||
29 | void backlight_set_on_when_charging(bool yesno); | ||
30 | |||
31 | #endif | ||
diff --git a/firmware/config-fmrecorder.h b/firmware/config-fmrecorder.h deleted file mode 100644 index 7befca8e52..0000000000 --- a/firmware/config-fmrecorder.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* define this if you have recording possibility */ | ||
2 | #define HAVE_RECORDING 1 | ||
3 | |||
4 | /* define this if you have a bitmap LCD display */ | ||
5 | #define HAVE_LCD_BITMAP 1 | ||
6 | |||
7 | /* define this if you have a Recorder style 10-key keyboard */ | ||
8 | #define HAVE_RECORDER_KEYPAD 1 | ||
9 | |||
10 | /* define this if you have a real-time clock */ | ||
11 | #define HAVE_RTC 1 | ||
12 | |||
13 | /* Define this if you have a MAS3587F */ | ||
14 | #define HAVE_MAS3587F | ||
15 | |||
16 | /* Define this if you have charging control */ | ||
17 | #define HAVE_CHARGE_CTRL | ||
18 | |||
19 | /* Define this if you have ATA power-off control */ | ||
20 | #define HAVE_ATA_POWER_OFF | ||
21 | |||
22 | /* Define this if you have a FM Recorder key system */ | ||
23 | #define HAVE_FMADC 1 | ||
24 | |||
25 | /* Define this if you have a LiIon battery */ | ||
26 | #define HAVE_LIION | ||
27 | |||
28 | /* Define this to the CPU frequency */ | ||
29 | #define CPU_FREQ 11059200 | ||
30 | |||
31 | /* Battery scale factor (?) */ | ||
32 | #define BATTERY_SCALE_FACTOR 6465 | ||
33 | |||
34 | /* Define this if you control power on PBDR (instead of PADR) */ | ||
35 | #define HAVE_POWEROFF_ON_PBDR | ||
36 | |||
37 | /* Offset ( in the firmware file's header ) to the file length */ | ||
38 | #define FIRMWARE_OFFSET_FILE_LENGTH 20 | ||
39 | |||
40 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
41 | #define FIRMWARE_OFFSET_FILE_CRC 6 | ||
42 | |||
43 | /* Offset ( in the firmware file's header ) to the real data */ | ||
44 | #define FIRMWARE_OFFSET_FILE_DATA 24 | ||
diff --git a/firmware/config-player.h b/firmware/config-player.h deleted file mode 100644 index d9a713d368..0000000000 --- a/firmware/config-player.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* define this if you have a charcell LCD display */ | ||
2 | #define HAVE_LCD_CHARCELLS 1 | ||
3 | |||
4 | /* define this if you have the Player's keyboard */ | ||
5 | #define HAVE_PLAYER_KEYPAD 1 | ||
6 | |||
7 | /* Define this if you have a MAS3507D */ | ||
8 | #define HAVE_MAS3507D | ||
9 | |||
10 | /* Define this if you have a DAC3550A */ | ||
11 | #define HAVE_DAC3550A | ||
12 | |||
13 | /* Define this to the CPU frequency */ | ||
14 | #define CPU_FREQ 12000000 /* cycle time ~83.3ns */ | ||
15 | |||
16 | /* Battery scale factor (?) */ | ||
17 | #define BATTERY_SCALE_FACTOR 6546 | ||
18 | |||
19 | /* Define this if you must discharge the data line by driving it low | ||
20 | and then set it to input to see if it stays low or goes high */ | ||
21 | #define HAVE_I2C_LOW_FIRST | ||
22 | |||
23 | /* Define this if you control power on PADR (instead of PBDR) */ | ||
24 | #define HAVE_POWEROFF_ON_PADR | ||
25 | |||
26 | /* Offset ( in the firmware file's header ) to the file length */ | ||
27 | #define FIRMWARE_OFFSET_FILE_LENGTH 0 | ||
28 | |||
29 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
30 | #define FIRMWARE_OFFSET_FILE_CRC 4 | ||
31 | |||
32 | /* Offset ( in the firmware file's header ) to the real data */ | ||
33 | #define FIRMWARE_OFFSET_FILE_DATA 6 | ||
diff --git a/firmware/config-recorder.h b/firmware/config-recorder.h deleted file mode 100644 index 33e40b7790..0000000000 --- a/firmware/config-recorder.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* define this if you have recording possibility */ | ||
2 | #define HAVE_RECORDING 1 | ||
3 | |||
4 | /* define this if you have a bitmap LCD display */ | ||
5 | #define HAVE_LCD_BITMAP 1 | ||
6 | |||
7 | /* define this if you have the Recorder's 10-key keyboard */ | ||
8 | #define HAVE_RECORDER_KEYPAD 1 | ||
9 | |||
10 | /* define this if you have a real-time clock */ | ||
11 | #define HAVE_RTC 1 | ||
12 | |||
13 | /* Define this if you have a MAS3587F */ | ||
14 | #define HAVE_MAS3587F | ||
15 | |||
16 | /* Define this if you have charging control */ | ||
17 | #define HAVE_CHARGE_CTRL | ||
18 | |||
19 | /* Define this if you have ATA power-off control */ | ||
20 | #define HAVE_ATA_POWER_OFF | ||
21 | |||
22 | /* Define this to the CPU frequency */ | ||
23 | #define CPU_FREQ 11059200 | ||
24 | |||
25 | /* Battery scale factor (?) */ | ||
26 | #define BATTERY_SCALE_FACTOR 6465 | ||
27 | |||
28 | /* Define this if you control power on PBDR (instead of PADR) */ | ||
29 | #define HAVE_POWEROFF_ON_PBDR | ||
30 | |||
31 | /* Offset ( in the firmware file's header ) to the file length */ | ||
32 | #define FIRMWARE_OFFSET_FILE_LENGTH 0 | ||
33 | |||
34 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
35 | #define FIRMWARE_OFFSET_FILE_CRC 4 | ||
36 | |||
37 | /* Offset ( in the firmware file's header ) to the real data */ | ||
38 | #define FIRMWARE_OFFSET_FILE_DATA 6 | ||
diff --git a/firmware/config.h b/firmware/config.h deleted file mode 100644 index d4b6f9e25b..0000000000 --- a/firmware/config.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef __CONFIG_H__ | ||
21 | #define __CONFIG_H__ | ||
22 | |||
23 | #if defined(ARCHOS_PLAYER) | ||
24 | #include "config-player.h" | ||
25 | #elif defined(ARCHOS_RECORDER) | ||
26 | #include "config-recorder.h" | ||
27 | #elif defined(ARCHOS_FMRECORDER) | ||
28 | #include "config-fmrecorder.h" | ||
29 | #else | ||
30 | /* no known platform */ | ||
31 | #endif | ||
32 | |||
33 | #endif | ||
diff --git a/firmware/debug.h b/firmware/debug.h deleted file mode 100644 index f8aa7d4113..0000000000 --- a/firmware/debug.h +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef DEBUG_H | ||
20 | #define DEBUG_H | ||
21 | |||
22 | extern void debug_init(void); | ||
23 | extern void debugf(char* fmt,...); | ||
24 | extern void ldebugf(char* file, int line, char *fmt, ...); | ||
25 | |||
26 | #ifdef __GNUC__ | ||
27 | |||
28 | /* */ | ||
29 | #if defined(SIMULATOR) | ||
30 | #define DEBUGF debugf | ||
31 | #define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) | ||
32 | #else | ||
33 | #if defined(DEBUG) | ||
34 | #define DEBUGF debugf | ||
35 | #define LDEBUGF debugf | ||
36 | #else | ||
37 | #define DEBUGF(...) | ||
38 | #define LDEBUGF(...) | ||
39 | #endif | ||
40 | #endif | ||
41 | |||
42 | |||
43 | #else | ||
44 | |||
45 | #define DEBUGF debugf | ||
46 | #define LDEBUGF debugf | ||
47 | |||
48 | #endif /* GCC */ | ||
49 | |||
50 | |||
51 | #endif | ||
diff --git a/firmware/font.h b/firmware/font.h deleted file mode 100644 index b45fccbbde..0000000000 --- a/firmware/font.h +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (c) 2002 by Greg Haerr <greg@censoft.com> | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | /* | ||
20 | * Incore font and image definitions | ||
21 | */ | ||
22 | #include "config.h" | ||
23 | |||
24 | #if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) | ||
25 | |||
26 | /* max static loadable fonts buffer*/ | ||
27 | #ifndef MAX_FONT_SIZE | ||
28 | #define MAX_FONT_SIZE 9000 /* max total fontsize allocation*/ | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * Fonts are specified by number, and used for display | ||
33 | * of menu information as well as mp3 filename data. | ||
34 | * At system startup, up to MAXFONTS fonts are initialized, | ||
35 | * either by being compiled-in, or loaded from disk. | ||
36 | * If the font asked for does not exist, then the | ||
37 | * system uses the next lower font number. Font 0 | ||
38 | * must be available at system startup. | ||
39 | * Fonts are specified in firmware/font.c. | ||
40 | */ | ||
41 | enum { | ||
42 | FONT_SYSFIXED, /* system fixed pitch font*/ | ||
43 | FONT_UI, /* system porportional font*/ | ||
44 | MAXFONTS | ||
45 | }; | ||
46 | |||
47 | /* | ||
48 | * .fnt loadable font file format definition | ||
49 | * | ||
50 | * format len description | ||
51 | * ------------------------- ---- ------------------------------ | ||
52 | * UCHAR version[4] 4 magic number and version bytes | ||
53 | * UCHAR name[64] 64 font name, space padded | ||
54 | * UCHAR copyright[256] 256 copyright info, space padded | ||
55 | * USHORT maxwidth 2 font max width in pixels | ||
56 | * USHORT height 2 font height in pixels | ||
57 | * USHORT ascent 2 font ascent (baseline) in pixels | ||
58 | * USHORT pad 2 unused, pad to 32-bit boundary | ||
59 | * ULONG firstchar 4 first character code in font | ||
60 | * ULONG defaultchar 4 default character code in font | ||
61 | * ULONG size 4 # characters in font | ||
62 | * ULONG nbits 4 # words imagebits data in file | ||
63 | * ULONG noffset 4 # longs offset data in file | ||
64 | * ULONG nwidth 4 # bytes width data in file | ||
65 | * MWIMAGEBITS bits nbits*2 image bits variable data | ||
66 | * [MWIMAGEBITS padded to 32-bit boundary] | ||
67 | * ULONG offset noffset*4 offset variable data | ||
68 | * UCHAR width nwidth*1 width variable data | ||
69 | */ | ||
70 | |||
71 | /* loadable font magic and version #*/ | ||
72 | #define VERSION "RB11" | ||
73 | |||
74 | typedef unsigned short bitmap_t; /* bitmap image unit size*/ | ||
75 | |||
76 | /* bitmap_t helper macros*/ | ||
77 | #define BITMAP_WORDS(x) (((x)+15)/16) /* image size in words*/ | ||
78 | #define BITMAP_BYTES(x) (BITMAP_WORDS(x)*sizeof(bitmap_t)) | ||
79 | #define BITMAP_BITSPERIMAGE (sizeof(bitmap_t) * 8) | ||
80 | #define BITMAP_BITVALUE(n) ((bitmap_t) (((bitmap_t) 1) << (n))) | ||
81 | #define BITMAP_FIRSTBIT (BITMAP_BITVALUE(BITMAP_BITSPERIMAGE - 1)) | ||
82 | #define BITMAP_TESTBIT(m) ((m) & BITMAP_FIRSTBIT) | ||
83 | #define BITMAP_SHIFTBIT(m) ((bitmap_t) ((m) << 1)) | ||
84 | |||
85 | /* builtin C-based proportional/fixed font structure */ | ||
86 | /* based on The Microwindows Project http://microwindows.org */ | ||
87 | struct font { | ||
88 | char * name; /* font name*/ | ||
89 | int maxwidth; /* max width in pixels*/ | ||
90 | unsigned int height; /* height in pixels*/ | ||
91 | int ascent; /* ascent (baseline) height*/ | ||
92 | int firstchar; /* first character in bitmap*/ | ||
93 | int size; /* font size in glyphs*/ | ||
94 | bitmap_t *bits; /* 16-bit right-padded bitmap data*/ | ||
95 | unsigned long *offset; /* offsets into bitmap data*/ | ||
96 | unsigned char *width; /* character widths or NULL if fixed*/ | ||
97 | int defaultchar; /* default char (not glyph index)*/ | ||
98 | long bits_size; /* # words of bitmap_t bits*/ | ||
99 | }; | ||
100 | |||
101 | /* font routines*/ | ||
102 | void font_init(void); | ||
103 | struct font* font_load(char *path); | ||
104 | struct font* font_get(int font); | ||
105 | void font_reset(void); | ||
106 | |||
107 | #else /* HAVE_LCD_BITMAP */ | ||
108 | |||
109 | #define font_init() | ||
110 | #define font_load(x) | ||
111 | |||
112 | #endif | ||
113 | |||
114 | /* ----------------------------------------------------------------- | ||
115 | * vim: et sw=4 ts=8 sts=4 tw=78 | ||
116 | */ | ||
diff --git a/firmware/hwcompat.h b/firmware/hwcompat.h deleted file mode 100644 index 52d831222f..0000000000 --- a/firmware/hwcompat.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef HWCOMPAT_H | ||
20 | #define HWCOMPAT_H | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include "config.h" | ||
24 | |||
25 | /* Bit mask values for HW compatibility */ | ||
26 | #define ATA_ADDRESS_200 0x0100 | ||
27 | #define USB_ACTIVE_HIGH 0x0100 | ||
28 | #define PR_ACTIVE_HIGH 0x0100 | ||
29 | |||
30 | int read_rom_version(void); | ||
31 | int read_hw_mask(void); | ||
32 | |||
33 | #ifdef HAVE_LCD_CHARCELLS | ||
34 | bool has_new_lcd(void); | ||
35 | #endif | ||
36 | |||
37 | #endif | ||
diff --git a/firmware/id3.h b/firmware/id3.h deleted file mode 100644 index 55ce002c2e..0000000000 --- a/firmware/id3.h +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef ID3_H | ||
20 | #define ID3_H | ||
21 | |||
22 | #include "file.h" | ||
23 | |||
24 | struct mp3entry { | ||
25 | char path[MAX_PATH]; | ||
26 | char *title; | ||
27 | char *artist; | ||
28 | char *album; | ||
29 | int tracknum; | ||
30 | int version; | ||
31 | int layer; | ||
32 | int year; | ||
33 | unsigned char id3version; | ||
34 | unsigned char genre; | ||
35 | unsigned int bitrate; | ||
36 | unsigned int frequency; | ||
37 | unsigned int id3v2len; | ||
38 | unsigned int id3v1len; | ||
39 | unsigned int first_frame_offset; /* Byte offset to first real MP3 frame. | ||
40 | Used for skipping leading garbage to | ||
41 | avoid gaps between tracks. */ | ||
42 | unsigned int filesize; /* in bytes */ | ||
43 | unsigned int length; /* song length */ | ||
44 | unsigned int elapsed; /* ms played */ | ||
45 | long bpf; /* bytes per frame */ | ||
46 | long tpf; /* time per frame */ | ||
47 | |||
48 | /* Xing VBR fields */ | ||
49 | bool vbr; | ||
50 | unsigned char vbrflags; | ||
51 | unsigned char toc[100];/* table of contents */ | ||
52 | |||
53 | /* these following two fields are used for local buffering */ | ||
54 | char id3v2buf[300]; | ||
55 | char id3v1buf[3][32]; | ||
56 | |||
57 | /* resume related */ | ||
58 | int offset; /* bytes played */ | ||
59 | int index; /* playlist index */ | ||
60 | }; | ||
61 | |||
62 | #define VBR_FRAMES_FLAG 0x01 | ||
63 | #define VBR_BYTES_FLAG 0x02 | ||
64 | #define VBR_TOC_FLAG 0x04 | ||
65 | |||
66 | enum { | ||
67 | ID3_VER_1_0 = 1, | ||
68 | ID3_VER_1_1, | ||
69 | ID3_VER_2_2, | ||
70 | ID3_VER_2_3, | ||
71 | ID3_VER_2_4 | ||
72 | }; | ||
73 | |||
74 | bool mp3info(struct mp3entry *entry, char *filename); | ||
75 | |||
76 | #endif | ||
diff --git a/firmware/mpeg.h b/firmware/mpeg.h deleted file mode 100644 index 75ec710a37..0000000000 --- a/firmware/mpeg.h +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _MPEG_H_ | ||
20 | #define _MPEG_H_ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | |||
24 | #define MPEG_SWAP_CHUNKSIZE 0x2000 | ||
25 | #define MPEG_HIGH_WATER 2 /* We leave 2 bytes empty because otherwise we | ||
26 | wouldn't be able to see the difference between | ||
27 | an empty buffer and a full one. */ | ||
28 | #define MPEG_LOW_WATER 0x60000 | ||
29 | #define MPEG_LOW_WATER_CHUNKSIZE 0x40000 | ||
30 | #define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000 | ||
31 | #define MPEG_PLAY_PENDING_THRESHOLD 0x10000 | ||
32 | #define MPEG_PLAY_PENDING_SWAPSIZE 0x10000 | ||
33 | |||
34 | struct mpeg_debug | ||
35 | { | ||
36 | int mp3buflen; | ||
37 | int mp3buf_write; | ||
38 | int mp3buf_swapwrite; | ||
39 | int mp3buf_read; | ||
40 | |||
41 | int last_dma_chunk_size; | ||
42 | |||
43 | bool dma_on; | ||
44 | bool playing; | ||
45 | bool play_pending; | ||
46 | bool is_playing; | ||
47 | bool filling; | ||
48 | bool dma_underrun; | ||
49 | |||
50 | int unplayed_space; | ||
51 | int playable_space; | ||
52 | int unswapped_space; | ||
53 | |||
54 | int low_watermark_level; | ||
55 | int lowest_watermark_level; | ||
56 | }; | ||
57 | |||
58 | void mpeg_init(int volume, int bass, int treble, int balance, | ||
59 | int loudness, int bass_boost, int avc); | ||
60 | void mpeg_play(int offset); | ||
61 | void mpeg_stop(void); | ||
62 | void mpeg_pause(void); | ||
63 | void mpeg_resume(void); | ||
64 | void mpeg_next(void); | ||
65 | void mpeg_prev(void); | ||
66 | void mpeg_ff_rewind(int change); | ||
67 | void mpeg_flush_and_reload_tracks(void); | ||
68 | void mpeg_sound_set(int setting, int value); | ||
69 | int mpeg_sound_min(int setting); | ||
70 | int mpeg_sound_max(int setting); | ||
71 | int mpeg_sound_default(int setting); | ||
72 | void mpeg_sound_channel_config(int configuration); | ||
73 | int mpeg_val2phys(int setting, int value); | ||
74 | int mpeg_phys2val(int setting, int value); | ||
75 | char *mpeg_sound_unit(int setting); | ||
76 | int mpeg_sound_numdecimals(int setting); | ||
77 | struct mp3entry* mpeg_current_track(void); | ||
78 | bool mpeg_has_changed_track(void); | ||
79 | int mpeg_status(void); | ||
80 | #if defined(HAVE_MAS3587F) || defined(SIMULATOR) | ||
81 | void mpeg_set_pitch(int percent); | ||
82 | void mpeg_init_recording(void); | ||
83 | void mpeg_init_playback(void); | ||
84 | void mpeg_record(char *filename); | ||
85 | void mpeg_set_recording_options(int frequency, int quality, | ||
86 | int source, int channel_mode); | ||
87 | void mpeg_set_recording_gain(int left, int right, int mic); | ||
88 | unsigned long mpeg_num_recorded_frames(void); | ||
89 | unsigned long mpeg_num_recorded_bytes(void); | ||
90 | #endif | ||
91 | void mpeg_get_debugdata(struct mpeg_debug *dbgdata); | ||
92 | void mpeg_set_buffer_margin(int seconds); | ||
93 | |||
94 | #define SOUND_VOLUME 0 | ||
95 | #define SOUND_BASS 1 | ||
96 | #define SOUND_TREBLE 2 | ||
97 | #define SOUND_BALANCE 3 | ||
98 | #define SOUND_LOUDNESS 4 | ||
99 | #define SOUND_SUPERBASS 5 | ||
100 | #define SOUND_AVC 6 | ||
101 | #define SOUND_CHANNELS 7 | ||
102 | #define SOUND_LEFT_GAIN 8 | ||
103 | #define SOUND_RIGHT_GAIN 9 | ||
104 | #define SOUND_MIC_GAIN 10 | ||
105 | #define SOUND_NUMSETTINGS 11 | ||
106 | |||
107 | #define MPEG_SOUND_STEREO 0 | ||
108 | #define MPEG_SOUND_MONO 1 | ||
109 | #define MPEG_SOUND_MONO_LEFT 2 | ||
110 | #define MPEG_SOUND_MONO_RIGHT 3 | ||
111 | |||
112 | #define MPEG_STATUS_PLAY 1 | ||
113 | #define MPEG_STATUS_PAUSE 2 | ||
114 | #define MPEG_STATUS_RECORD 4 | ||
115 | |||
116 | #endif | ||
diff --git a/firmware/panic.h b/firmware/panic.h deleted file mode 100644 index 585f827927..0000000000 --- a/firmware/panic.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by wavey@wavey.org | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef __PANIC_H__ | ||
21 | #define __PANIC_H__ | ||
22 | |||
23 | void panicf( char *fmt, ... ); | ||
24 | |||
25 | #endif /* __PANIC_H__ */ | ||
diff --git a/firmware/powermgmt.h b/firmware/powermgmt.h deleted file mode 100644 index a3e212b63a..0000000000 --- a/firmware/powermgmt.h +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _POWERMGMT_H_ | ||
20 | #define _POWERMGMT_H_ | ||
21 | |||
22 | #ifndef SIMULATOR | ||
23 | |||
24 | #ifdef HAVE_LIION /* FM Recorder, LiIon */ | ||
25 | #define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */ | ||
26 | #define BATTERY_LEVEL_EMPTY 265 /* 2.65V */ | ||
27 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ | ||
28 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ | ||
29 | |||
30 | #else /* Recorder, NiMH */ | ||
31 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ | ||
32 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ | ||
33 | #define BATTERY_LEVEL_DANGEROUS 475 /* 4.75V */ | ||
34 | #define BATTERY_LEVEL_FULL 585 /* 5.85V */ | ||
35 | #endif | ||
36 | |||
37 | #define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY) | ||
38 | #define BATTERY_CAPACITY_MAX 2400 /* max. capacity that can be selected in settings menu, min. is always 1500 */ | ||
39 | |||
40 | #define POWER_HISTORY_LEN 2*60 /* 2 hours of samples, one per minute */ | ||
41 | #define POWER_AVG_N 4 /* how many samples to take for each measurement */ | ||
42 | #define POWER_AVG_SLEEP 9 /* how long do we sleep between each measurement */ | ||
43 | |||
44 | #define CHARGE_END_NEGD 6 /* stop when N minutes have passed with | ||
45 | * avg delta being < -0.05 V */ | ||
46 | #define CHARGE_END_ZEROD 50 /* stop when N minutes have passed with | ||
47 | * avg delta being < 0.005 V */ | ||
48 | |||
49 | #ifdef HAVE_CHARGE_CTRL | ||
50 | #define POWER_MESSAGE_LEN 32 /* power thread status message */ | ||
51 | #define CHARGE_MAX_TIME_1500 450 /* minutes: maximum charging time for 1500 mAh batteries */ | ||
52 | /* actual max time depends also on BATTERY_CAPACITY! */ | ||
53 | #define CHARGE_MIN_TIME 10 /* minutes: minimum charging time */ | ||
54 | #define CHARGE_RESTART_HI 85 /* %: when to restart charging in 'charge' mode */ | ||
55 | /* attention: if set too high, normal charging is started in trickle mode */ | ||
56 | #define CHARGE_RESTART_LO 10 /* %: when to restart charging in 'discharge' mode */ | ||
57 | #define CHARGE_PAUSE_LEN 60 /* how many minutes to pause between charging cycles */ | ||
58 | #define TOPOFF_MAX_TIME 90 /* After charging, go to top off charge. How long should top off charge be? */ | ||
59 | #define TOPOFF_VOLTAGE 565 /* which voltage is best? (centivolts) */ | ||
60 | #define TRICKLE_MAX_TIME 12*60 /* After top off charge, go to trickle charge. How long should trickle charge be? */ | ||
61 | #define TRICKLE_VOLTAGE 545 /* which voltage is best? (centivolts) */ | ||
62 | |||
63 | extern char power_message[POWER_MESSAGE_LEN]; | ||
64 | extern char charge_restart_level; | ||
65 | |||
66 | extern int powermgmt_last_cycle_startstop_min; /* how many minutes ago was the charging started or stopped? */ | ||
67 | extern int powermgmt_last_cycle_level; /* which level had the batteries at this time? */ | ||
68 | |||
69 | extern int battery_lazyness[20]; /* how does the battery react when plugging in/out the charger */ | ||
70 | void enable_trickle_charge(bool on); | ||
71 | extern int trickle_sec; /* trickle charge: How many seconds per minute are we charging actually? */ | ||
72 | extern int charge_state; /* tells what the charger is doing (for info display): 0: decharging/charger off, 1: charge, 2: top-off, 3: trickle */ | ||
73 | |||
74 | #endif /* HAVE_CHARGE_CTRL */ | ||
75 | |||
76 | #define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */ | ||
77 | #define CURRENT_USB 500 /* usual current in mA in USB mode */ | ||
78 | #define CURRENT_BACKLIGHT 30 /* additional current when backlight is always on */ | ||
79 | #define CURRENT_CHARGING 300 /* charging current */ | ||
80 | |||
81 | extern unsigned short power_history[POWER_HISTORY_LEN]; | ||
82 | |||
83 | /* Start up power management thread */ | ||
84 | void power_init(void); | ||
85 | |||
86 | #endif /* SIMULATOR */ | ||
87 | |||
88 | /* Returns battery level in percent */ | ||
89 | int battery_level(void); | ||
90 | int battery_time(void); /* minutes */ | ||
91 | |||
92 | /* Tells if the battery level is safe for disk writes */ | ||
93 | bool battery_level_safe(void); | ||
94 | |||
95 | void set_poweroff_timeout(int timeout); | ||
96 | void set_battery_capacity(int capacity); /* set local battery capacity value */ | ||
97 | |||
98 | void set_sleep_timer(int seconds); | ||
99 | int get_sleep_timer(void); | ||
100 | |||
101 | #endif | ||
diff --git a/firmware/rolo.h b/firmware/rolo.h deleted file mode 100644 index e2dd814c1a..0000000000 --- a/firmware/rolo.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Randy D. Wood | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef __ROLO_H__ | ||
20 | #define __ROLO_H__ | ||
21 | |||
22 | void rolo_load(char* file); | ||
23 | |||
24 | #endif | ||
diff --git a/firmware/system.h b/firmware/system.h deleted file mode 100644 index d5f1b4ba97..0000000000 --- a/firmware/system.h +++ /dev/null | |||
@@ -1,267 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef __SYSTEM_H__ | ||
21 | #define __SYSTEM_H__ | ||
22 | |||
23 | #include "sh7034.h" | ||
24 | #include "config.h" | ||
25 | |||
26 | #define FREQ CPU_FREQ | ||
27 | #define BAUDRATE 9600 | ||
28 | |||
29 | #ifndef NULL | ||
30 | #define NULL ((void*)0) | ||
31 | #endif | ||
32 | |||
33 | #ifndef MIN | ||
34 | #define MIN(a, b) (((a)<(b))?(a):(b)) | ||
35 | #endif | ||
36 | |||
37 | #ifndef MAX | ||
38 | #define MAX(a, b) (((a)>(b))?(a):(b)) | ||
39 | #endif | ||
40 | |||
41 | #ifdef LITTLE_ENDIAN | ||
42 | #define SWAB16(x) (x) | ||
43 | #define SWAB32(x) (x) | ||
44 | #endif | ||
45 | |||
46 | #define nop \ | ||
47 | asm volatile ("nop") | ||
48 | |||
49 | #define __set_mask_constant(mask,address) \ | ||
50 | asm \ | ||
51 | ("or.b\t%0,@(r0,gbr)" \ | ||
52 | : \ | ||
53 | : /* %0 */ "I"((char)(mask)), \ | ||
54 | /* %1 */ "z"(address-GBR)) | ||
55 | |||
56 | #define __clear_mask_constant(mask,address) \ | ||
57 | asm \ | ||
58 | ("and.b\t%0,@(r0,gbr)" \ | ||
59 | : \ | ||
60 | : /* %0 */ "I"((char)~(mask)), \ | ||
61 | /* %1 */ "z"(address-GBR)) | ||
62 | |||
63 | #define __toggle_mask_constant(mask,address) \ | ||
64 | asm \ | ||
65 | ("xor.b\t%0,@(r0,gbr)" \ | ||
66 | : \ | ||
67 | : /* %0 */ "I"((char)(mask)), \ | ||
68 | /* %1 */ "z"(address-GBR)) | ||
69 | |||
70 | #define __test_mask_constant(mask,address) \ | ||
71 | ({ \ | ||
72 | int result; \ | ||
73 | asm \ | ||
74 | ("tst.b\t%1,@(r0,gbr)\n\tmovt\t%0" \ | ||
75 | : "=r"(result) \ | ||
76 | : "I"((char)(mask)),"z"(address-GBR)); \ | ||
77 | result; \ | ||
78 | }) | ||
79 | |||
80 | #define __set_bit_constant(bit,address) \ | ||
81 | asm \ | ||
82 | ("or.b\t%0,@(r0,gbr)" \ | ||
83 | : \ | ||
84 | : /* %0 */ "I"((char)(1<<(bit))), \ | ||
85 | /* %1 */ "z"(address-GBR)) | ||
86 | |||
87 | #define __clear_bit_constant(bit,address) \ | ||
88 | asm \ | ||
89 | ("and.b\t%0,@(r0,gbr)" \ | ||
90 | : \ | ||
91 | : /* %0 */ "I"((char)~(1<<(bit))), \ | ||
92 | /* %1 */ "z"(address-GBR)) | ||
93 | |||
94 | #define __toggle_bit_constant(bit,address) \ | ||
95 | asm \ | ||
96 | ("xor.b\t%0,@(r0,gbr)" \ | ||
97 | : \ | ||
98 | : /* %0 */ "I"((char)(1<<(bit))), \ | ||
99 | /* %1 */ "z"(address-GBR)) | ||
100 | |||
101 | #define __test_bit_constant(bit,address) \ | ||
102 | ({ \ | ||
103 | int result; \ | ||
104 | asm \ | ||
105 | ("tst.b\t%1,@(r0,gbr)\n\tmovt\t%0" \ | ||
106 | : "=r"(result) \ | ||
107 | : "I"((char)(1<<(bit))),"z"(address-GBR)); \ | ||
108 | result; \ | ||
109 | }) | ||
110 | |||
111 | #define __set_mask(mask,address) /* FIXME */ | ||
112 | #define __test_mask(mask,address) 0 /* FIXME */ | ||
113 | #define __clear_mask(mask,address) /* FIXME */ | ||
114 | #define __toggle_mask(mask,address) /* FIXME */ | ||
115 | |||
116 | #define __set_bit(bit,address) /* FIXME */ | ||
117 | #define __test_bit(bit,address) 0 /* FIXME */ | ||
118 | #define __clear_bit(bit,address) /* FIXME */ | ||
119 | #define __toggle_bit(bit,address) /* FIXME */ | ||
120 | |||
121 | #define set_mask(mask,address) \ | ||
122 | if (__builtin_constant_p (mask)) \ | ||
123 | __set_mask_constant (mask,address); \ | ||
124 | else \ | ||
125 | __set_mask (mask,address) | ||
126 | |||
127 | #define clear_mask(mask,address) \ | ||
128 | if (__builtin_constant_p (mask)) \ | ||
129 | __clear_mask_constant (mask,address); \ | ||
130 | else \ | ||
131 | __clear_mask (mask,address) | ||
132 | |||
133 | #define toggle_mask(mask,address) \ | ||
134 | if (__builtin_constant_p (mask)) \ | ||
135 | __toggle_mask_constant (mask,address); \ | ||
136 | else \ | ||
137 | __toggle_mask (mask,address) | ||
138 | |||
139 | #define test_mask(mask,address) \ | ||
140 | ( \ | ||
141 | (__builtin_constant_p (mask)) \ | ||
142 | ? (int)__test_mask_constant (mask,address) \ | ||
143 | : (int)__test_mask (mask,address) \ | ||
144 | ) | ||
145 | |||
146 | |||
147 | #define set_bit(bit,address) \ | ||
148 | if (__builtin_constant_p (bit)) \ | ||
149 | __set_bit_constant (bit,address); \ | ||
150 | else \ | ||
151 | __set_bit (bit,address) | ||
152 | |||
153 | #define clear_bit(bit,address) \ | ||
154 | if (__builtin_constant_p (bit)) \ | ||
155 | __clear_bit_constant (bit,address); \ | ||
156 | else \ | ||
157 | __clear_bit (bit,address) | ||
158 | |||
159 | #define toggle_bit(bit,address) \ | ||
160 | if (__builtin_constant_p (bit)) \ | ||
161 | __toggle_bit_constant (bit,address); \ | ||
162 | else \ | ||
163 | __toggle_bit (bit,address) | ||
164 | |||
165 | #define test_bit(bit,address) \ | ||
166 | ( \ | ||
167 | (__builtin_constant_p (bit)) \ | ||
168 | ? (int)__test_bit_constant (bit,address) \ | ||
169 | : (int)__test_bit (bit,address) \ | ||
170 | ) | ||
171 | |||
172 | |||
173 | extern char __swap_bit[256]; | ||
174 | |||
175 | #define swap_bit(byte) \ | ||
176 | __swap_bit[byte] | ||
177 | |||
178 | #ifndef SIMULATOR | ||
179 | |||
180 | static inline short SWAB16(short value) | ||
181 | /* | ||
182 | result[15..8] = value[ 7..0]; | ||
183 | result[ 7..0] = value[15..8]; | ||
184 | */ | ||
185 | { | ||
186 | short result; | ||
187 | asm volatile ("swap.b\t%1,%0" : "=r"(result) : "r"(value)); | ||
188 | return result; | ||
189 | } | ||
190 | |||
191 | static inline long SWAW32(long value) | ||
192 | /* | ||
193 | result[31..16] = value[15.. 0]; | ||
194 | result[15.. 0] = value[31..16]; | ||
195 | */ | ||
196 | { | ||
197 | long result; | ||
198 | asm volatile ("swap.w\t%1,%0" : "=r"(result) : "r"(value)); | ||
199 | return result; | ||
200 | } | ||
201 | |||
202 | static inline long SWAB32(long value) | ||
203 | /* | ||
204 | result[31..24] = value[ 7.. 0]; | ||
205 | result[23..16] = value[15.. 8]; | ||
206 | result[15.. 8] = value[23..16]; | ||
207 | result[ 7.. 0] = value[31..24]; | ||
208 | */ | ||
209 | { | ||
210 | asm volatile ("swap.b\t%0,%0\n" | ||
211 | "swap.w\t%0,%0\n" | ||
212 | "swap.b\t%0,%0\n" : "+r"(value)); | ||
213 | return value; | ||
214 | } | ||
215 | |||
216 | /* Test And Set - UNTESTED */ | ||
217 | static inline int tas (volatile int *pointer) | ||
218 | { | ||
219 | int result; | ||
220 | asm volatile ("tas.b\t@%1;movt\t%0" : "=t"(result) : "r"((char *)pointer) : "memory"); | ||
221 | return result; | ||
222 | } | ||
223 | |||
224 | static inline void sti (void) | ||
225 | { | ||
226 | asm volatile ("ldc\t%0,sr" : : "r"(0<<4)); | ||
227 | } | ||
228 | |||
229 | static inline void cli (void) | ||
230 | { | ||
231 | asm volatile ("ldc\t%0,sr" : : "r"(15<<4)); | ||
232 | } | ||
233 | |||
234 | /* Compare And Swap */ | ||
235 | static inline int cas (volatile int *pointer,int requested_value,int new_value) | ||
236 | { | ||
237 | cli(); | ||
238 | if (*pointer == requested_value) | ||
239 | { | ||
240 | *pointer = new_value; | ||
241 | sti (); | ||
242 | return 1; | ||
243 | } | ||
244 | sti (); | ||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | static inline int cas2 (volatile int *pointer1,volatile int *pointer2,int requested_value1,int requested_value2,int new_value1,int new_value2) | ||
249 | { | ||
250 | cli(); | ||
251 | if (*pointer1 == requested_value1 && *pointer2 == requested_value2) | ||
252 | { | ||
253 | *pointer1 = new_value1; | ||
254 | *pointer2 = new_value2; | ||
255 | sti (); | ||
256 | return 1; | ||
257 | } | ||
258 | sti (); | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | #endif | ||
263 | |||
264 | extern void system_reboot (void); | ||
265 | extern void system_init(void); | ||
266 | |||
267 | #endif | ||
diff --git a/firmware/thread.h b/firmware/thread.h deleted file mode 100644 index 7940ddfcf6..0000000000 --- a/firmware/thread.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Ulf Ralberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef THREAD_H | ||
20 | #define THREAD_H | ||
21 | |||
22 | #define MAXTHREADS 16 | ||
23 | #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ | ||
24 | |||
25 | int create_thread(void* function, void* stack, int stack_size, char *name); | ||
26 | void switch_thread(void); | ||
27 | void init_threads(void); | ||
28 | int thread_stack_usage(int threadnum); | ||
29 | |||
30 | #endif | ||
diff --git a/firmware/usb.h b/firmware/usb.h deleted file mode 100644 index 089b0f23e6..0000000000 --- a/firmware/usb.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef _USB_H_ | ||
20 | #define _USB_H_ | ||
21 | |||
22 | #include "kernel.h" | ||
23 | |||
24 | void usb_init(void); | ||
25 | void usb_start_monitoring(void); | ||
26 | void usb_acknowledge(int id); | ||
27 | void usb_wait_for_disconnect(struct event_queue *q); | ||
28 | int usb_wait_for_disconnect_w_tmo(struct event_queue *q, int ticks); | ||
29 | bool usb_inserted(void); | ||
30 | |||
31 | #endif | ||