summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-04-20 20:11:01 +0000
committerThomas Martitz <kugel@rockbox.org>2009-04-20 20:11:01 +0000
commite29358c154e5412737dbc9375c90b3046c49b90b (patch)
treebcca0390d65bc9d3311fcebba5961be2b6fa4bcb
parentf4ac75752e7b76b8aa24208a8d344b427351af6d (diff)
downloadrockbox-e29358c154e5412737dbc9375c90b3046c49b90b.tar.gz
rockbox-e29358c154e5412737dbc9375c90b3046c49b90b.zip
Fix FS#10128 - The View IO Ports debug menu showed weird dbop values (sometimes FFFF prepended), due to sign-extension. Switch to unsigned short to fix it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20757 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c2
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c10
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/button-target.h2
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/button-fuze.c10
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/button-target.h2
5 files changed, 13 insertions, 13 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index a8a973b9b2..8e2d90ca3b 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -43,7 +43,7 @@
43 * if I put the below into a sansa-fuze/debug-target.h, it doesn't work*/ 43 * if I put the below into a sansa-fuze/debug-target.h, it doesn't work*/
44#if defined(SANSA_FUZE) || defined(SANSA_E200V2) 44#if defined(SANSA_FUZE) || defined(SANSA_E200V2)
45#define DEBUG_DBOP 45#define DEBUG_DBOP
46short button_dbop_data(void); 46unsigned short button_dbop_data(void);
47#endif 47#endif
48 48
49static unsigned read_cp15 (void) 49static unsigned read_cp15 (void)
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c
index 932ce2bada..624466b1a6 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c
@@ -31,7 +31,7 @@ static bool hold_button = false;
31#ifndef BOOTLOADER 31#ifndef BOOTLOADER
32static bool hold_button_old = false; 32static bool hold_button_old = false;
33#endif 33#endif
34static short _dbop_din = 0; 34static unsigned short _dbop_din = 0;
35 35
36#define WHEEL_REPEAT_INTERVAL (HZ/5) 36#define WHEEL_REPEAT_INTERVAL (HZ/5)
37/* in the lcd driver */ 37/* in the lcd driver */
@@ -48,7 +48,7 @@ bool button_hold(void)
48} 48}
49 49
50#if !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL) 50#if !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL)
51static void scrollwheel(short dbop_din) 51static void scrollwheel(unsigned short dbop_din)
52{ 52{
53 /* current wheel values, parsed from dbop and the resulting button */ 53 /* current wheel values, parsed from dbop and the resulting button */
54 unsigned wheel_value = 0; 54 unsigned wheel_value = 0;
@@ -132,7 +132,7 @@ static void scrollwheel(short dbop_din)
132} 132}
133#endif /* !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL) */ 133#endif /* !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL) */
134 134
135short button_read_dbop(void) 135unsigned short button_read_dbop(void)
136{ 136{
137 /*write a red pixel */ 137 /*write a red pixel */
138 if (!lcd_button_support()) 138 if (!lcd_button_support())
@@ -161,7 +161,7 @@ short button_read_dbop(void)
161 return _dbop_din; 161 return _dbop_din;
162} 162}
163 163
164short button_dbop_data(void) 164unsigned short button_dbop_data(void)
165{ 165{
166 return _dbop_din; 166 return _dbop_din;
167} 167}
@@ -173,7 +173,7 @@ int button_read_device(void)
173{ 173{
174 int btn = BUTTON_NONE; 174 int btn = BUTTON_NONE;
175 /* read buttons from dbop */ 175 /* read buttons from dbop */
176 short dbop = button_read_dbop(); 176 unsigned short dbop = button_read_dbop();
177 177
178 /* hold button */ 178 /* hold button */
179 if(dbop & (1<<12)) 179 if(dbop & (1<<12))
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-target.h b/firmware/target/arm/as3525/sansa-e200v2/button-target.h
index e09743d89c..b1feb58cad 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/button-target.h
+++ b/firmware/target/arm/as3525/sansa-e200v2/button-target.h
@@ -30,7 +30,7 @@
30bool button_hold(void); 30bool button_hold(void);
31void button_init_device(void); 31void button_init_device(void);
32int button_read_device(void); 32int button_read_device(void);
33short button_read_dbop(void); 33unsigned short button_read_dbop(void);
34 34
35/* Sandisk Sansa E200 button codes */ 35/* Sandisk Sansa E200 button codes */
36 36
diff --git a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c
index f14e6f49c1..efa1c593a3 100644
--- a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c
+++ b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c
@@ -37,7 +37,7 @@ static bool hold_button = false;
37#ifndef BOOTLOADER 37#ifndef BOOTLOADER
38static bool hold_button_old = false; 38static bool hold_button_old = false;
39#endif 39#endif
40static short _dbop_din = BUTTON_NONE; 40static unsigned short _dbop_din = BUTTON_NONE;
41 41
42/* in the lcd driver */ 42/* in the lcd driver */
43extern bool lcd_button_support(void); 43extern bool lcd_button_support(void);
@@ -49,7 +49,7 @@ void button_init_device(void)
49} 49}
50 50
51#if !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL) 51#if !defined(BOOTLOADER) && defined(HAVE_SCROLLWHEEL)
52static void scrollwheel(short dbop_din) 52static void scrollwheel(unsigned short dbop_din)
53{ 53{
54 /* current wheel values, parsed from dbop and the resulting button */ 54 /* current wheel values, parsed from dbop and the resulting button */
55 unsigned wheel_value = 0; 55 unsigned wheel_value = 0;
@@ -143,7 +143,7 @@ static void button_delay(void)
143 while(i--); 143 while(i--);
144} 144}
145 145
146short button_read_dbop(void) 146unsigned short button_read_dbop(void)
147{ 147{
148 /* skip home and power reading if lcd_button_support was blocked, 148 /* skip home and power reading if lcd_button_support was blocked,
149 * since the dbop bit 15 is invalid then, and use the old value instead */ 149 * since the dbop bit 15 is invalid then, and use the old value instead */
@@ -187,7 +187,7 @@ short button_read_dbop(void)
187} 187}
188 188
189/* for the debug menu */ 189/* for the debug menu */
190short button_dbop_data(void) 190unsigned short button_dbop_data(void)
191{ 191{
192 return _dbop_din; 192 return _dbop_din;
193} 193}
@@ -238,7 +238,7 @@ static int button_gpio(void)
238int button_read_device(void) 238int button_read_device(void)
239{ 239{
240 int btn = BUTTON_NONE; 240 int btn = BUTTON_NONE;
241 short dbop = button_read_dbop(); 241 unsigned short dbop = button_read_dbop();
242 static unsigned power_counter = 0; 242 static unsigned power_counter = 0;
243 /* hold button */ 243 /* hold button */
244 if(dbop & (1<<12)) 244 if(dbop & (1<<12))
diff --git a/firmware/target/arm/as3525/sansa-fuze/button-target.h b/firmware/target/arm/as3525/sansa-fuze/button-target.h
index 5b5b1e097f..8527604379 100644
--- a/firmware/target/arm/as3525/sansa-fuze/button-target.h
+++ b/firmware/target/arm/as3525/sansa-fuze/button-target.h
@@ -30,7 +30,7 @@
30void button_init_device(void); 30void button_init_device(void);
31bool button_hold(void); 31bool button_hold(void);
32int button_read_device(void); 32int button_read_device(void);
33short button_read_dbop(void); 33unsigned short button_read_dbop(void);
34/* Sandisk Sansa Fuze button codes */ 34/* Sandisk Sansa Fuze button codes */
35 35
36/* Main unit's buttons */ 36/* Main unit's buttons */