diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 23:12:04 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 23:12:04 +0000 |
commit | 71b2d2811b8cd8747f81a2e69e07aaa72a56b1c2 (patch) | |
tree | 32df72165a80694201469d31202ec0a46be38d1a | |
parent | bf82ac06bfd9b40dadcca3b16da24a75eabe8e6f (diff) | |
download | rockbox-71b2d2811b8cd8747f81a2e69e07aaa72a56b1c2.tar.gz rockbox-71b2d2811b8cd8747f81a2e69e07aaa72a56b1c2.zip |
jz4740 debug: use lcd_putsf() instead of redefining it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27934 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/debug-jz4740.c | 92 |
1 files changed, 39 insertions, 53 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c index 07b3802bf2..f2b302e4c1 100644 --- a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c | |||
@@ -31,20 +31,6 @@ | |||
31 | #include "timefuncs.h" | 31 | #include "timefuncs.h" |
32 | 32 | ||
33 | static int line = 0; | 33 | static int line = 0; |
34 | static void printf(const char *format, ...) | ||
35 | { | ||
36 | int len; | ||
37 | unsigned char *ptr; | ||
38 | char printfbuf[256]; | ||
39 | va_list ap; | ||
40 | va_start(ap, format); | ||
41 | |||
42 | ptr = printfbuf; | ||
43 | len = vsnprintf(ptr, sizeof(printfbuf), format, ap); | ||
44 | va_end(ap); | ||
45 | |||
46 | lcd_puts(0, line++, ptr); | ||
47 | } | ||
48 | 34 | ||
49 | /* | 35 | /* |
50 | * Clock Generation Module | 36 | * Clock Generation Module |
@@ -59,39 +45,39 @@ static void display_clocks(void) | |||
59 | unsigned int div[] = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32}; | 45 | unsigned int div[] = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32}; |
60 | unsigned int od[4] = {1, 2, 2, 4}; | 46 | unsigned int od[4] = {1, 2, 2, 4}; |
61 | 47 | ||
62 | printf("CPPCR : 0x%08x", cppcr); | 48 | lcd_putsf(0, line++, "CPPCR : 0x%08x", cppcr); |
63 | printf("CPCCR : 0x%08x", cpccr); | 49 | lcd_putsf(0, line++, "CPCCR : 0x%08x", cpccr); |
64 | printf("PLL : %s", (cppcr & CPM_CPPCR_PLLEN) ? "ON" : "OFF"); | 50 | lcd_putsf(0, line++, "PLL : %s", (cppcr & CPM_CPPCR_PLLEN) ? "ON" : "OFF"); |
65 | printf("m:n:o : %d:%d:%d", | 51 | lcd_putsf(0, line++, "m:n:o : %d:%d:%d", |
66 | __cpm_get_pllm() + 2, | 52 | __cpm_get_pllm() + 2, |
67 | __cpm_get_plln() + 2, | 53 | __cpm_get_plln() + 2, |
68 | od[__cpm_get_pllod()] | 54 | od[__cpm_get_pllod()] |
69 | ); | 55 | ); |
70 | printf("C:H:M:P : %d:%d:%d:%d", | 56 | lcd_putsf(0, line++, "C:H:M:P : %d:%d:%d:%d", |
71 | div[__cpm_get_cdiv()], | 57 | div[__cpm_get_cdiv()], |
72 | div[__cpm_get_hdiv()], | 58 | div[__cpm_get_hdiv()], |
73 | div[__cpm_get_mdiv()], | 59 | div[__cpm_get_mdiv()], |
74 | div[__cpm_get_pdiv()] | 60 | div[__cpm_get_pdiv()] |
75 | ); | 61 | ); |
76 | printf("U:L:I:P:M : %d:%d:%d:%d:%d", | 62 | lcd_putsf(0, line++, "U:L:I:P:M : %d:%d:%d:%d:%d", |
77 | __cpm_get_udiv() + 1, | 63 | __cpm_get_udiv() + 1, |
78 | __cpm_get_ldiv() + 1, | 64 | __cpm_get_ldiv() + 1, |
79 | __cpm_get_i2sdiv()+1, | 65 | __cpm_get_i2sdiv()+1, |
80 | __cpm_get_pixdiv()+1, | 66 | __cpm_get_pixdiv()+1, |
81 | __cpm_get_mscdiv()+1 | 67 | __cpm_get_mscdiv()+1 |
82 | ); | 68 | ); |
83 | printf("PLL Freq: %3d.%02d MHz", TO_MHZ(__cpm_get_pllout())); | 69 | lcd_putsf(0, line++, "PLL Freq: %3d.%02d MHz", TO_MHZ(__cpm_get_pllout())); |
84 | printf("CCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_cclk())); | 70 | lcd_putsf(0, line++, "CCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_cclk())); |
85 | printf("HCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_hclk())); | 71 | lcd_putsf(0, line++, "HCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_hclk())); |
86 | printf("MCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mclk())); | 72 | lcd_putsf(0, line++, "MCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mclk())); |
87 | printf("PCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_pclk())); | 73 | lcd_putsf(0, line++, "PCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_pclk())); |
88 | printf("LCDCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_lcdclk())); | 74 | lcd_putsf(0, line++, "LCDCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_lcdclk())); |
89 | printf("PIXCLK : %6d.%02d KHz", TO_KHZ(__cpm_get_pixclk())); | 75 | lcd_putsf(0, line++, "PIXCLK : %6d.%02d KHz", TO_KHZ(__cpm_get_pixclk())); |
90 | printf("I2SCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_i2sclk())); | 76 | lcd_putsf(0, line++, "I2SCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_i2sclk())); |
91 | printf("USBCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_usbclk())); | 77 | lcd_putsf(0, line++, "USBCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_usbclk())); |
92 | printf("MSCCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mscclk())); | 78 | lcd_putsf(0, line++, "MSCCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mscclk())); |
93 | printf("EXTALCLK: %3d.%02d MHz", TO_MHZ(__cpm_get_extalclk())); | 79 | lcd_putsf(0, line++, "EXTALCLK: %3d.%02d MHz", TO_MHZ(__cpm_get_extalclk())); |
94 | printf("RTCCLK : %3d.%02d KHz", TO_KHZ(__cpm_get_rtcclk())); | 80 | lcd_putsf(0, line++, "RTCCLK : %3d.%02d KHz", TO_KHZ(__cpm_get_rtcclk())); |
95 | } | 81 | } |
96 | 82 | ||
97 | static void display_enabled_clocks(void) | 83 | static void display_enabled_clocks(void) |
@@ -99,47 +85,47 @@ static void display_enabled_clocks(void) | |||
99 | unsigned long lcr = REG_CPM_LCR; | 85 | unsigned long lcr = REG_CPM_LCR; |
100 | unsigned long clkgr = REG_CPM_CLKGR; | 86 | unsigned long clkgr = REG_CPM_CLKGR; |
101 | 87 | ||
102 | printf("Low Power Mode : %s", | 88 | lcd_putsf(0, line++, "Low Power Mode : %s", |
103 | ((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_IDLE) ? | 89 | ((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_IDLE) ? |
104 | "IDLE" : (((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_SLEEP) ? "SLEEP" : "HIBERNATE") | 90 | "IDLE" : (((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_SLEEP) ? "SLEEP" : "HIBERNATE") |
105 | ); | 91 | ); |
106 | 92 | ||
107 | printf("Doze Mode : %s", | 93 | lcd_putsf(0, line++, "Doze Mode : %s", |
108 | (lcr & CPM_LCR_DOZE_ON) ? "ON" : "OFF"); | 94 | (lcr & CPM_LCR_DOZE_ON) ? "ON" : "OFF"); |
109 | if (lcr & CPM_LCR_DOZE_ON) | 95 | if (lcr & CPM_LCR_DOZE_ON) |
110 | printf(" duty : %d", (int)((lcr & CPM_LCR_DOZE_DUTY_MASK) >> CPM_LCR_DOZE_DUTY_BIT)); | 96 | lcd_putsf(0, line++, " duty : %d", (int)((lcr & CPM_LCR_DOZE_DUTY_MASK) >> CPM_LCR_DOZE_DUTY_BIT)); |
111 | 97 | ||
112 | printf("IPU : %s", | 98 | lcd_putsf(0, line++, "IPU : %s", |
113 | (clkgr & CPM_CLKGR_IPU) ? "stopped" : "running"); | 99 | (clkgr & CPM_CLKGR_IPU) ? "stopped" : "running"); |
114 | printf("DMAC : %s", | 100 | lcd_putsf(0, line++, "DMAC : %s", |
115 | (clkgr & CPM_CLKGR_DMAC) ? "stopped" : "running"); | 101 | (clkgr & CPM_CLKGR_DMAC) ? "stopped" : "running"); |
116 | printf("UHC : %s", | 102 | lcd_putsf(0, line++, "UHC : %s", |
117 | (clkgr & CPM_CLKGR_UHC) ? "stopped" : "running"); | 103 | (clkgr & CPM_CLKGR_UHC) ? "stopped" : "running"); |
118 | printf("UDC : %s", | 104 | lcd_putsf(0, line++, "UDC : %s", |
119 | (clkgr & CPM_CLKGR_UDC) ? "stopped" : "running"); | 105 | (clkgr & CPM_CLKGR_UDC) ? "stopped" : "running"); |
120 | printf("LCD : %s", | 106 | lcd_putsf(0, line++, "LCD : %s", |
121 | (clkgr & CPM_CLKGR_LCD) ? "stopped" : "running"); | 107 | (clkgr & CPM_CLKGR_LCD) ? "stopped" : "running"); |
122 | printf("CIM : %s", | 108 | lcd_putsf(0, line++, "CIM : %s", |
123 | (clkgr & CPM_CLKGR_CIM) ? "stopped" : "running"); | 109 | (clkgr & CPM_CLKGR_CIM) ? "stopped" : "running"); |
124 | printf("SADC : %s", | 110 | lcd_putsf(0, line++, "SADC : %s", |
125 | (clkgr & CPM_CLKGR_SADC) ? "stopped" : "running"); | 111 | (clkgr & CPM_CLKGR_SADC) ? "stopped" : "running"); |
126 | printf("MSC : %s", | 112 | lcd_putsf(0, line++, "MSC : %s", |
127 | (clkgr & CPM_CLKGR_MSC) ? "stopped" : "running"); | 113 | (clkgr & CPM_CLKGR_MSC) ? "stopped" : "running"); |
128 | printf("AIC1 : %s", | 114 | lcd_putsf(0, line++, "AIC1 : %s", |
129 | (clkgr & CPM_CLKGR_AIC1) ? "stopped" : "running"); | 115 | (clkgr & CPM_CLKGR_AIC1) ? "stopped" : "running"); |
130 | printf("AIC2 : %s", | 116 | lcd_putsf(0, line++, "AIC2 : %s", |
131 | (clkgr & CPM_CLKGR_AIC2) ? "stopped" : "running"); | 117 | (clkgr & CPM_CLKGR_AIC2) ? "stopped" : "running"); |
132 | printf("SSI : %s", | 118 | lcd_putsf(0, line++, "SSI : %s", |
133 | (clkgr & CPM_CLKGR_SSI) ? "stopped" : "running"); | 119 | (clkgr & CPM_CLKGR_SSI) ? "stopped" : "running"); |
134 | printf("I2C : %s", | 120 | lcd_putsf(0, line++, "I2C : %s", |
135 | (clkgr & CPM_CLKGR_I2C) ? "stopped" : "running"); | 121 | (clkgr & CPM_CLKGR_I2C) ? "stopped" : "running"); |
136 | printf("RTC : %s", | 122 | lcd_putsf(0, line++, "RTC : %s", |
137 | (clkgr & CPM_CLKGR_RTC) ? "stopped" : "running"); | 123 | (clkgr & CPM_CLKGR_RTC) ? "stopped" : "running"); |
138 | printf("TCU : %s", | 124 | lcd_putsf(0, line++, "TCU : %s", |
139 | (clkgr & CPM_CLKGR_TCU) ? "stopped" : "running"); | 125 | (clkgr & CPM_CLKGR_TCU) ? "stopped" : "running"); |
140 | printf("UART1 : %s", | 126 | lcd_putsf(0, line++, "UART1 : %s", |
141 | (clkgr & CPM_CLKGR_UART1) ? "stopped" : "running"); | 127 | (clkgr & CPM_CLKGR_UART1) ? "stopped" : "running"); |
142 | printf("UART0 : %s", | 128 | lcd_putsf(0, line++, "UART0 : %s", |
143 | (clkgr & CPM_CLKGR_UART0) ? "stopped" : "running"); | 129 | (clkgr & CPM_CLKGR_UART0) ? "stopped" : "running"); |
144 | } | 130 | } |
145 | 131 | ||
@@ -165,12 +151,12 @@ bool __dbg_hw_info(void) | |||
165 | display_enabled_clocks(); | 151 | display_enabled_clocks(); |
166 | #ifdef HAVE_TOUCHSCREEN | 152 | #ifdef HAVE_TOUCHSCREEN |
167 | btn = button_read_device(&touch); | 153 | btn = button_read_device(&touch); |
168 | printf("X: %d Y: %d BTN: 0x%X", touch>>16, touch&0xFFFF, btn); | 154 | lcd_putsf(0, line++, "X: %d Y: %d BTN: 0x%X", touch>>16, touch&0xFFFF, btn); |
169 | #else | 155 | #else |
170 | btn = button_read_device(); | 156 | btn = button_read_device(); |
171 | #endif | 157 | #endif |
172 | cur_time = get_time(); | 158 | cur_time = get_time(); |
173 | printf("%02d/%02d/%04d %02d:%02d:%02d", cur_time->tm_mday, | 159 | lcd_putsf(0, line++, "%02d/%02d/%04d %02d:%02d:%02d", cur_time->tm_mday, |
174 | cur_time->tm_mon, cur_time->tm_year, cur_time->tm_hour, | 160 | cur_time->tm_mon, cur_time->tm_year, cur_time->tm_hour, |
175 | cur_time->tm_min, cur_time->tm_sec); | 161 | cur_time->tm_min, cur_time->tm_sec); |
176 | lcd_update(); | 162 | lcd_update(); |