summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-23 13:54:05 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-23 13:54:05 +0000
commitd86cf998e887d6e1bac2754b3087710926c74a19 (patch)
tree655d5db3e005175ef688221e8e8ec5efdd3174e3
parent28a2b4514f762131fe8b78e1db1f3e9b498a7b61 (diff)
downloadrockbox-d86cf998e887d6e1bac2754b3087710926c74a19.tar.gz
rockbox-d86cf998e887d6e1bac2754b3087710926c74a19.zip
Sansa AMS debug: small fixes
- Indentation fix - Put braces around _DEBUG_PRINTF macro - read_cp15() is only 1 instruction so inline it, and it doesn't access memory git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21477 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 405b7109b1..39f590302d 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -29,8 +29,9 @@
29#include "cpu.h" 29#include "cpu.h"
30#include "pl180.h" 30#include "pl180.h"
31 31
32#define _DEBUG_PRINTF(a,varargs...) \ 32#define _DEBUG_PRINTF(a,varargs...) do { \
33 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf) 33 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \
34 } while(0)
34 35
35#define ON "Enabled" 36#define ON "Enabled"
36#define OFF "Disabled" 37#define OFF "Disabled"
@@ -70,15 +71,12 @@
70unsigned short button_dbop_data(void); 71unsigned short button_dbop_data(void);
71#endif 72#endif
72 73
73static unsigned read_cp15 (void) 74static inline unsigned read_cp15 (void)
74{ 75{
75 unsigned value; 76 unsigned cp15_value;
76
77 asm volatile ( 77 asm volatile (
78 "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n":"=r" 78 "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n" : "=r"(cp15_value));
79 (value)::"memory" 79 return (cp15_value);
80 );
81 return (value);
82} 80}
83 81
84int calc_freq(int clk) 82int calc_freq(int clk)
@@ -222,7 +220,7 @@ int calc_freq(int clk)
222 220
223bool __dbg_hw_info(void) 221bool __dbg_hw_info(void)
224{ 222{
225char buf[50]; 223 char buf[50];
226 int line; 224 int line;
227 225
228 lcd_clear_display(); 226 lcd_clear_display();