diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/debug-as3525.c | 49 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-c200v2/debug-target.h (renamed from firmware/target/arm/as3525/debug-target.h) | 1 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-clip/debug-target.h | 26 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-e200v2/debug-target.h | 26 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/button-fuze.c | 12 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuze/debug-target.h | 28 | ||||
-rw-r--r-- | firmware/target/arm/as3525/sansa-m200v4/debug-target.h | 26 |
7 files changed, 160 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 8a2f8838d6..a08d33e3da 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c | |||
@@ -21,15 +21,60 @@ | |||
21 | 21 | ||
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | #include "debug-target.h" | 23 | #include "debug-target.h" |
24 | #include "button.h" | ||
25 | #include "lcd.h" | ||
26 | #include "font.h" | ||
27 | #include "system.h" | ||
28 | #include "sprintf.h" | ||
29 | |||
30 | |||
31 | #define _DEBUG_PRINTF(a,varargs...) \ | ||
32 | snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf) | ||
24 | 33 | ||
25 | /* TODO */ | 34 | /* TODO */ |
26 | 35 | ||
27 | bool __dbg_ports(void) | 36 | bool __dbg_hw_info(void) |
28 | { | 37 | { |
29 | return false; | 38 | return false; |
30 | } | 39 | } |
31 | 40 | ||
32 | bool __dbg_hw_info(void) | 41 | bool __dbg_ports(void) |
33 | { | 42 | { |
43 | char buf[50]; | ||
44 | int line, i; | ||
45 | char counter = 0; | ||
46 | |||
47 | lcd_clear_display(); | ||
48 | lcd_setfont(FONT_SYSFIXED); | ||
49 | char gpio_data[4] = {0,0,0,0}; | ||
50 | |||
51 | while(1) | ||
52 | { | ||
53 | line = 0; | ||
54 | for (i = 0; i < 8; i++) | ||
55 | { | ||
56 | gpio_data[0] |= GPIOA_PIN(i) & (1<<i); | ||
57 | gpio_data[1] |= GPIOB_PIN(i) & (1<<i); | ||
58 | gpio_data[2] |= GPIOC_PIN(i) & (1<<i); | ||
59 | gpio_data[3] |= GPIOD_PIN(i) & (1<<i); | ||
60 | } | ||
61 | |||
62 | line++; | ||
63 | _DEBUG_PRINTF("[GPIO Values and Directions]"); | ||
64 | _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR); | ||
65 | _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR); | ||
66 | _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR); | ||
67 | _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR); | ||
68 | line++; | ||
69 | #ifdef TRACK_DBOP_DIN | ||
70 | _DEBUG_PRINTF("[DBOP_DIN]"); | ||
71 | _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din); | ||
72 | #endif | ||
73 | memset(gpio_data, 0, sizeof(gpio_data)); | ||
74 | lcd_update(); | ||
75 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | ||
76 | break; | ||
77 | } | ||
78 | lcd_setfont(FONT_UI); | ||
34 | return false; | 79 | return false; |
35 | } | 80 | } |
diff --git a/firmware/target/arm/as3525/debug-target.h b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h index d3b7a28aee..0769a2f11d 100644 --- a/firmware/target/arm/as3525/debug-target.h +++ b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h | |||
@@ -21,5 +21,6 @@ | |||
21 | 21 | ||
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | 23 | ||
24 | #define DEBUG_CANCEL BUTTON_LEFT | ||
24 | bool __dbg_hw_info(void); | 25 | bool __dbg_hw_info(void); |
25 | bool __dbg_ports(void); | 26 | bool __dbg_ports(void); |
diff --git a/firmware/target/arm/as3525/sansa-clip/debug-target.h b/firmware/target/arm/as3525/sansa-clip/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clip/debug-target.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | |||
24 | #define DEBUG_CANCEL BUTTON_LEFT | ||
25 | bool __dbg_hw_info(void); | ||
26 | bool __dbg_ports(void); | ||
diff --git a/firmware/target/arm/as3525/sansa-e200v2/debug-target.h b/firmware/target/arm/as3525/sansa-e200v2/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-e200v2/debug-target.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | |||
24 | #define DEBUG_CANCEL BUTTON_LEFT | ||
25 | bool __dbg_hw_info(void); | ||
26 | bool __dbg_ports(void); | ||
diff --git a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c index ff07965f90..e52a1d37d8 100644 --- a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c | |||
@@ -42,8 +42,8 @@ static bool hold_button_old = false; | |||
42 | #else | 42 | #else |
43 | #define hold_button false | 43 | #define hold_button false |
44 | #endif /* !BOOTLOADER */ | 44 | #endif /* !BOOTLOADER */ |
45 | static int int_btn = BUTTON_NONE; | 45 | static int int_btn = BUTTON_NONE; |
46 | static short dbop_din = BUTTON_NONE; | 46 | short _dbop_din = BUTTON_NONE; |
47 | 47 | ||
48 | void button_init_device(void) | 48 | void button_init_device(void) |
49 | { | 49 | { |
@@ -76,7 +76,7 @@ static void get_wheel(void) | |||
76 | { 2, 0, 3, 1 }, /* Clockwise rotation */ | 76 | { 2, 0, 3, 1 }, /* Clockwise rotation */ |
77 | { 1, 3, 0, 2 }, /* Counter-clockwise */ | 77 | { 1, 3, 0, 2 }, /* Counter-clockwise */ |
78 | }; | 78 | }; |
79 | wheel_value = dbop_din & (1<<13|1<<14); | 79 | wheel_value = _dbop_din & (1<<13|1<<14); |
80 | wheel_value >>= 13; | 80 | wheel_value >>= 13; |
81 | /* did the wheel value change? */ | 81 | /* did the wheel value change? */ |
82 | if (!hold_button) | 82 | if (!hold_button) |
@@ -130,7 +130,7 @@ static void get_wheel(void) | |||
130 | /* get hold button state */ | 130 | /* get hold button state */ |
131 | static void get_hold(void) | 131 | static void get_hold(void) |
132 | { | 132 | { |
133 | hold_button = dbop_din & (1<<12); | 133 | hold_button = _dbop_din & (1<<12); |
134 | } | 134 | } |
135 | #endif | 135 | #endif |
136 | 136 | ||
@@ -141,7 +141,7 @@ bool button_hold(void) | |||
141 | 141 | ||
142 | static void get_power(void) | 142 | static void get_power(void) |
143 | { | 143 | { |
144 | if (dbop_din & (1<<8)) | 144 | if (_dbop_din & (1<<8)) |
145 | int_btn |= BUTTON_POWER; | 145 | int_btn |= BUTTON_POWER; |
146 | } | 146 | } |
147 | 147 | ||
@@ -172,7 +172,7 @@ static void get_button_from_dbob(void) | |||
172 | temp = DBOP_STAT; | 172 | temp = DBOP_STAT; |
173 | } while ((temp & (1<<16)) == 0); /* wait for valid data */ | 173 | } while ((temp & (1<<16)) == 0); /* wait for valid data */ |
174 | 174 | ||
175 | dbop_din = DBOP_DIN; /* now read */ | 175 | _dbop_din = DBOP_DIN; /* now read */ |
176 | 176 | ||
177 | DBOP_TIMPOL_01 = 0x6e167; | 177 | DBOP_TIMPOL_01 = 0x6e167; |
178 | DBOP_TIMPOL_23 = 0xa167e06f; | 178 | DBOP_TIMPOL_23 = 0xa167e06f; |
diff --git a/firmware/target/arm/as3525/sansa-fuze/debug-target.h b/firmware/target/arm/as3525/sansa-fuze/debug-target.h new file mode 100644 index 0000000000..7ba5b2e4db --- /dev/null +++ b/firmware/target/arm/as3525/sansa-fuze/debug-target.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | |||
24 | #define DEBUG_CANCEL BUTTON_LEFT | ||
25 | #define TRACK_DBOP_DIN | ||
26 | extern short _dbop_din; | ||
27 | bool __dbg_hw_info(void); | ||
28 | bool __dbg_ports(void); | ||
diff --git a/firmware/target/arm/as3525/sansa-m200v4/debug-target.h b/firmware/target/arm/as3525/sansa-m200v4/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-m200v4/debug-target.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Karl Kurbjun | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | |||
24 | #define DEBUG_CANCEL BUTTON_LEFT | ||
25 | bool __dbg_hw_info(void); | ||
26 | bool __dbg_ports(void); | ||