diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-10-17 18:02:48 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-10-17 18:02:48 +0000 |
commit | f34a841b0cc5d1a605375209e1b013b388f741bc (patch) | |
tree | 90c780494fa42ffe34e3504d6fe3dc026a91d457 | |
parent | 5ca76ab9c4af0759f1bcf75ce24c47ccd38fc962 (diff) | |
download | rockbox-f34a841b0cc5d1a605375209e1b013b388f741bc.tar.gz rockbox-f34a841b0cc5d1a605375209e1b013b388f741bc.zip |
Revise r23225 a bit, removing the debug_printf function and implementing more generic lcd_(remote)_putsf function(s) instead and use those in more places
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23233 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/alarm_menu.c | 22 | ||||
-rw-r--r-- | apps/debug_menu.c | 359 | ||||
-rw-r--r-- | apps/main.c | 10 | ||||
-rw-r--r-- | apps/recorder/recording.c | 11 | ||||
-rw-r--r-- | apps/screen_access.c | 2 | ||||
-rw-r--r-- | apps/screen_access.h | 1 | ||||
-rw-r--r-- | apps/screens.c | 7 | ||||
-rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 14 | ||||
-rw-r--r-- | firmware/drivers/lcd-charcell.c | 14 | ||||
-rw-r--r-- | firmware/export/lcd-remote.h | 1 | ||||
-rw-r--r-- | firmware/export/lcd.h | 1 | ||||
-rw-r--r-- | firmware/target/arm/as3525/debug-as3525.c | 82 | ||||
-rw-r--r-- | firmware/target/arm/imx31/debug-imx31.c | 112 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/debug-s3c2440.c | 51 | ||||
-rw-r--r-- | firmware/target/arm/system-arm.c | 5 | ||||
-rwxr-xr-x | firmware/target/arm/tms320dm320/debug-dm320.c | 69 | ||||
-rw-r--r-- | firmware/target/coldfire/system-coldfire.c | 7 | ||||
-rw-r--r-- | firmware/target/sh/system-sh.c | 11 |
18 files changed, 366 insertions, 413 deletions
diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c index 413d176c7e..6473bbab82 100644 --- a/apps/alarm_menu.c +++ b/apps/alarm_menu.c | |||
@@ -41,14 +41,14 @@ | |||
41 | #include "splash.h" | 41 | #include "splash.h" |
42 | #include "viewport.h" | 42 | #include "viewport.h" |
43 | 43 | ||
44 | static void speak_time(int hours, int minutes, bool speak_hours) | 44 | static void speak_time(int hours, int minutes, bool speak_hours, bool enqueue) |
45 | { | 45 | { |
46 | if (global_settings.talk_menu){ | 46 | if (global_settings.talk_menu){ |
47 | if(speak_hours) { | 47 | if(speak_hours) { |
48 | talk_value(hours, UNIT_HOUR, false); | 48 | talk_value(hours, UNIT_HOUR, enqueue); |
49 | talk_value(minutes, UNIT_MIN, true); | 49 | talk_value(minutes, UNIT_MIN, true); |
50 | } else { | 50 | } else { |
51 | talk_value(minutes, UNIT_MIN, false); | 51 | talk_value(minutes, UNIT_MIN, enqueue); |
52 | } | 52 | } |
53 | } | 53 | } |
54 | } | 54 | } |
@@ -56,8 +56,7 @@ static void speak_time(int hours, int minutes, bool speak_hours) | |||
56 | bool alarm_screen(void) | 56 | bool alarm_screen(void) |
57 | { | 57 | { |
58 | int h, m; | 58 | int h, m; |
59 | bool done=false; | 59 | bool done = false; |
60 | char buf[32]; | ||
61 | struct tm *tm; | 60 | struct tm *tm; |
62 | int togo; | 61 | int togo; |
63 | int button; | 62 | int button; |
@@ -90,19 +89,14 @@ bool alarm_screen(void) | |||
90 | screens[i].puts(0, 3, str(LANG_ALARM_MOD_KEYS)); | 89 | screens[i].puts(0, 3, str(LANG_ALARM_MOD_KEYS)); |
91 | } | 90 | } |
92 | /* Talk when entering the wakeup screen */ | 91 | /* Talk when entering the wakeup screen */ |
93 | if (global_settings.talk_menu) | 92 | speak_time(h, m, true, true); |
94 | { | ||
95 | talk_value(h, UNIT_HOUR, true); | ||
96 | talk_value(m, UNIT_MIN, true); | ||
97 | } | ||
98 | update = false; | 93 | update = false; |
99 | } | 94 | } |
100 | 95 | ||
101 | snprintf(buf, 32, str(LANG_ALARM_MOD_TIME), h, m); | ||
102 | FOR_NB_SCREENS(i) | 96 | FOR_NB_SCREENS(i) |
103 | { | 97 | { |
104 | screens[i].set_viewport(&vp[i]); | 98 | screens[i].set_viewport(&vp[i]); |
105 | screens[i].puts(0, 1, buf); | 99 | screens[i].putsf(0, 1, str(LANG_ALARM_MOD_TIME), h, m); |
106 | screens[i].update_viewport(); | 100 | screens[i].update_viewport(); |
107 | screens[i].set_viewport(NULL); | 101 | screens[i].set_viewport(NULL); |
108 | } | 102 | } |
@@ -147,7 +141,7 @@ bool alarm_screen(void) | |||
147 | if (h == 24) | 141 | if (h == 24) |
148 | h = 0; | 142 | h = 0; |
149 | 143 | ||
150 | speak_time(h, m, hour_wrapped); | 144 | speak_time(h, m, hour_wrapped, false); |
151 | break; | 145 | break; |
152 | 146 | ||
153 | /* dec(m) */ | 147 | /* dec(m) */ |
@@ -162,7 +156,7 @@ bool alarm_screen(void) | |||
162 | if (h == -1) | 156 | if (h == -1) |
163 | h = 23; | 157 | h = 23; |
164 | 158 | ||
165 | speak_time(h, m, hour_wrapped); | 159 | speak_time(h, m, hour_wrapped, false); |
166 | break; | 160 | break; |
167 | 161 | ||
168 | /* inc(h) */ | 162 | /* inc(h) */ |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 9886843723..a0b285ae79 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -122,17 +122,6 @@ | |||
122 | #include "usb_core.h" | 122 | #include "usb_core.h" |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | /* wrapper function to format a string and print it */ | ||
126 | void debug_printf(int y, const unsigned char *fmt, ...) | ||
127 | { | ||
128 | va_list ap; | ||
129 | char buf[128]; | ||
130 | va_start(ap, fmt); | ||
131 | vsnprintf(buf, sizeof (buf), fmt, ap); | ||
132 | va_end(ap); | ||
133 | lcd_puts(0, y, buf); | ||
134 | } | ||
135 | |||
136 | /*---------------------------------------------------*/ | 125 | /*---------------------------------------------------*/ |
137 | /* SPECIAL DEBUG STUFF */ | 126 | /* SPECIAL DEBUG STUFF */ |
138 | /*---------------------------------------------------*/ | 127 | /*---------------------------------------------------*/ |
@@ -258,12 +247,12 @@ static bool dbg_audio_thread(void) | |||
258 | 247 | ||
259 | lcd_clear_display(); | 248 | lcd_clear_display(); |
260 | 249 | ||
261 | debug_printf(0, "read: %x", d.audiobuf_read); | 250 | lcd_putsf(0, 0, "read: %x", d.audiobuf_read); |
262 | debug_printf(1, "write: %x", d.audiobuf_write); | 251 | lcd_putsf(0, 1, "write: %x", d.audiobuf_write); |
263 | debug_printf(2, "swap: %x", d.audiobuf_swapwrite); | 252 | lcd_putsf(0, 2, "swap: %x", d.audiobuf_swapwrite); |
264 | debug_printf(3, "playing: %d", d.playing); | 253 | lcd_putsf(0, 3, "playing: %d", d.playing); |
265 | debug_printf(4, "playable: %x", d.playable_space); | 254 | lcd_putsf(0, 4, "playable: %x", d.playable_space); |
266 | debug_printf(5, "unswapped: %x", d.unswapped_space); | 255 | lcd_putsf(0, 5, "unswapped: %x", d.unswapped_space); |
267 | 256 | ||
268 | /* Playable space left */ | 257 | /* Playable space left */ |
269 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8, 112, 4, d.audiobuflen, 0, | 258 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8, 112, 4, d.audiobuflen, 0, |
@@ -273,7 +262,7 @@ static bool dbg_audio_thread(void) | |||
273 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8+4, 112, 4, d.audiobuflen, 0, | 262 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, 6*8+4, 112, 4, d.audiobuflen, 0, |
274 | d.low_watermark_level, HORIZONTAL); | 263 | d.low_watermark_level, HORIZONTAL); |
275 | 264 | ||
276 | debug_printf(7, "wm: %x - %x", | 265 | lcd_putsf(0, 7, "wm: %x - %x", |
277 | d.low_watermark_level, d.lowest_watermark_level); | 266 | d.low_watermark_level, d.lowest_watermark_level); |
278 | 267 | ||
279 | lcd_update(); | 268 | lcd_update(); |
@@ -336,13 +325,13 @@ static bool dbg_buffering_thread(void) | |||
336 | 325 | ||
337 | bufused = bufsize - pcmbuf_free(); | 326 | bufused = bufsize - pcmbuf_free(); |
338 | 327 | ||
339 | debug_printf(line++, "pcm: %6ld/%ld", (long) bufused, (long) bufsize); | 328 | lcd_putsf(0, line++, "pcm: %6ld/%ld", (long) bufused, (long) bufsize); |
340 | 329 | ||
341 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, | 330 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, |
342 | bufsize, 0, bufused, HORIZONTAL); | 331 | bufsize, 0, bufused, HORIZONTAL); |
343 | line++; | 332 | line++; |
344 | 333 | ||
345 | debug_printf(line++, "alloc: %6ld/%ld", audio_filebufused(), | 334 | lcd_putsf(0, line++, "alloc: %6ld/%ld", audio_filebufused(), |
346 | (long) filebuflen); | 335 | (long) filebuflen); |
347 | 336 | ||
348 | #if LCD_HEIGHT > 80 | 337 | #if LCD_HEIGHT > 80 |
@@ -350,7 +339,7 @@ static bool dbg_buffering_thread(void) | |||
350 | filebuflen, 0, audio_filebufused(), HORIZONTAL); | 339 | filebuflen, 0, audio_filebufused(), HORIZONTAL); |
351 | line++; | 340 | line++; |
352 | 341 | ||
353 | debug_printf(line++, "real: %6ld/%ld", (long)d.buffered_data, | 342 | lcd_putsf(0, line++, "real: %6ld/%ld", (long)d.buffered_data, |
354 | (long)filebuflen); | 343 | (long)filebuflen); |
355 | 344 | ||
356 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, | 345 | gui_scrollbar_draw(&screens[SCREEN_MAIN],0, line*8, LCD_WIDTH, 6, |
@@ -358,7 +347,7 @@ static bool dbg_buffering_thread(void) | |||
358 | line++; | 347 | line++; |
359 | #endif | 348 | #endif |
360 | 349 | ||
361 | debug_printf(line++, "usefl: %6ld/%ld", (long)(d.useful_data), | 350 | lcd_putsf(0, line++, "usefl: %6ld/%ld", (long)(d.useful_data), |
362 | (long)filebuflen); | 351 | (long)filebuflen); |
363 | 352 | ||
364 | #if LCD_HEIGHT > 80 | 353 | #if LCD_HEIGHT > 80 |
@@ -367,14 +356,14 @@ static bool dbg_buffering_thread(void) | |||
367 | line++; | 356 | line++; |
368 | #endif | 357 | #endif |
369 | 358 | ||
370 | debug_printf(line++, "data_rem: %ld", (long)d.data_rem); | 359 | lcd_putsf(0, line++, "data_rem: %ld", (long)d.data_rem); |
371 | 360 | ||
372 | debug_printf(line++, "track count: %2d", audio_track_count()); | 361 | lcd_putsf(0, line++, "track count: %2d", audio_track_count()); |
373 | 362 | ||
374 | debug_printf(line++, "handle count: %d", (int)d.num_handles); | 363 | lcd_putsf(0, line++, "handle count: %d", (int)d.num_handles); |
375 | 364 | ||
376 | #ifndef SIMULATOR | 365 | #ifndef SIMULATOR |
377 | debug_printf(line++, "cpu freq: %3dMHz", | 366 | lcd_putsf(0, line++, "cpu freq: %3dMHz", |
378 | (int)((FREQ + 500000) / 1000000)); | 367 | (int)((FREQ + 500000) / 1000000)); |
379 | #endif | 368 | #endif |
380 | 369 | ||
@@ -382,13 +371,13 @@ static bool dbg_buffering_thread(void) | |||
382 | { | 371 | { |
383 | int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */ | 372 | int boostquota = boost_ticks * 1000 / ticks; /* in 0.1 % */ |
384 | int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */ | 373 | int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */ |
385 | debug_printf(line++, "boost:%3d.%d%% (%d.%dMHz)", | 374 | lcd_putsf(0, line++, "boost:%3d.%d%% (%d.%dMHz)", |
386 | boostquota/10, boostquota%10, avgclock/10, avgclock%10); | 375 | boostquota/10, boostquota%10, avgclock/10, avgclock%10); |
387 | } | 376 | } |
388 | 377 | ||
389 | debug_printf(line++, "pcmbufdesc: %2d/%2d", | 378 | lcd_putsf(0, line++, "pcmbufdesc: %2d/%2d", |
390 | pcmbuf_used_descs(), pcmbufdescs); | 379 | pcmbuf_used_descs(), pcmbufdescs); |
391 | debug_printf(line++, "watermark: %6d", | 380 | lcd_putsf(0, line++, "watermark: %6d", |
392 | (int)(d.watermark)); | 381 | (int)(d.watermark)); |
393 | 382 | ||
394 | lcd_update(); | 383 | lcd_update(); |
@@ -530,12 +519,12 @@ static bool dbg_hw_info(void) | |||
530 | 519 | ||
531 | lcd_puts(0, 0, "[Hardware info]"); | 520 | lcd_puts(0, 0, "[Hardware info]"); |
532 | 521 | ||
533 | debug_printf(1, "ROM: %d.%02d", rom_version/100, rom_version%100); | 522 | lcd_putsf(0, 1, "ROM: %d.%02d", rom_version/100, rom_version%100); |
534 | 523 | ||
535 | debug_printf(2, "Mask: 0x%04x", bitmask); | 524 | lcd_putsf(0, 2, "Mask: 0x%04x", bitmask); |
536 | 525 | ||
537 | if (got_id) | 526 | if (got_id) |
538 | debug_printf(3, "Flash: M=%02x D=%02x", manu, id); | 527 | lcd_putsf(0, 3, "Flash: M=%02x D=%02x", manu, id); |
539 | else | 528 | else |
540 | lcd_puts(0, 3, "Flash: M=?? D=??"); /* unknown, sorry */ | 529 | lcd_puts(0, 3, "Flash: M=?? D=??"); /* unknown, sorry */ |
541 | 530 | ||
@@ -544,7 +533,7 @@ static bool dbg_hw_info(void) | |||
544 | if (rom_crc == 0x56DBA4EE) /* known Version 1 */ | 533 | if (rom_crc == 0x56DBA4EE) /* known Version 1 */ |
545 | lcd_puts(0, 4, "Boot ROM: V1"); | 534 | lcd_puts(0, 4, "Boot ROM: V1"); |
546 | else | 535 | else |
547 | debug_printf(4, "ROMcrc: 0x%08x", rom_crc); | 536 | lcd_putsf(0, 4, "ROMcrc: 0x%08x", rom_crc); |
548 | } | 537 | } |
549 | else | 538 | else |
550 | { | 539 | { |
@@ -576,7 +565,7 @@ static bool dbg_hw_info(void) | |||
576 | lcd_puts(0, line++, "[Hardware info]"); | 565 | lcd_puts(0, line++, "[Hardware info]"); |
577 | 566 | ||
578 | if (got_id) | 567 | if (got_id) |
579 | debug_printf(line++, "Flash: M=%04x D=%04x", manu, id); | 568 | lcd_putsf(0, line++, "Flash: M=%04x D=%04x", manu, id); |
580 | else | 569 | else |
581 | lcd_puts(0, line++, "Flash: M=???? D=????"); /* unknown, sorry */ | 570 | lcd_puts(0, line++, "Flash: M=???? D=????"); /* unknown, sorry */ |
582 | 571 | ||
@@ -590,15 +579,15 @@ static bool dbg_hw_info(void) | |||
590 | 579 | ||
591 | if (got_id == DS2411_OK) | 580 | if (got_id == DS2411_OK) |
592 | { | 581 | { |
593 | debug_printf(++line, " FC=%02x", (unsigned)id.family_code); | 582 | lcd_putsf(0, ++line, " FC=%02x", (unsigned)id.family_code); |
594 | debug_printf(++line, " ID=%02X %02X %02X %02X %02X %02X", | 583 | lcd_putsf(0, ++line, " ID=%02X %02X %02X %02X %02X %02X", |
595 | (unsigned)id.uid[0], (unsigned)id.uid[1], (unsigned)id.uid[2], | 584 | (unsigned)id.uid[0], (unsigned)id.uid[1], (unsigned)id.uid[2], |
596 | (unsigned)id.uid[3], (unsigned)id.uid[4], (unsigned)id.uid[5]); | 585 | (unsigned)id.uid[3], (unsigned)id.uid[4], (unsigned)id.uid[5]); |
597 | debug_printf(++line, " CRC=%02X", (unsigned)id.crc); | 586 | lcd_putsf(0, ++line, " CRC=%02X", (unsigned)id.crc); |
598 | } | 587 | } |
599 | else | 588 | else |
600 | { | 589 | { |
601 | debug_printf(++line, "READ ERR=%d", got_id); | 590 | lcd_putsf(0, ++line, "READ ERR=%d", got_id); |
602 | } | 591 | } |
603 | } | 592 | } |
604 | #endif | 593 | #endif |
@@ -620,18 +609,18 @@ static bool dbg_hw_info(void) | |||
620 | lcd_puts(0, line++, "[Hardware info]"); | 609 | lcd_puts(0, line++, "[Hardware info]"); |
621 | 610 | ||
622 | #ifdef IPOD_ARCH | 611 | #ifdef IPOD_ARCH |
623 | debug_printf(line++, "HW rev: 0x%08lx", IPOD_HW_REVISION); | 612 | lcd_putsf(0, line++, "HW rev: 0x%08lx", IPOD_HW_REVISION); |
624 | #endif | 613 | #endif |
625 | 614 | ||
626 | #ifdef IPOD_COLOR | 615 | #ifdef IPOD_COLOR |
627 | extern int lcd_type; /* Defined in lcd-colornano.c */ | 616 | extern int lcd_type; /* Defined in lcd-colornano.c */ |
628 | 617 | ||
629 | debug_printf(line++, "LCD type: %d", lcd_type); | 618 | lcd_putsf(0, line++, "LCD type: %d", lcd_type); |
630 | #endif | 619 | #endif |
631 | 620 | ||
632 | debug_printf(line++, "PP version: %s", pp_version); | 621 | lcd_putsf(0, line++, "PP version: %s", pp_version); |
633 | 622 | ||
634 | debug_printf(line++, "Est. clock (kHz): %d", perfcheck()); | 623 | lcd_putsf(0, line++, "Est. clock (kHz): %d", perfcheck()); |
635 | 624 | ||
636 | lcd_update(); | 625 | lcd_update(); |
637 | 626 | ||
@@ -651,12 +640,12 @@ static bool dbg_hw_info(void) | |||
651 | lcd_puts(0, line++, "[Hardware info]"); | 640 | lcd_puts(0, line++, "[Hardware info]"); |
652 | 641 | ||
653 | #ifdef IPOD_ARCH | 642 | #ifdef IPOD_ARCH |
654 | debug_printf(line++, "HW rev: 0x%08lx", IPOD_HW_REVISION); | 643 | lcd_putsf(0, line++, "HW rev: 0x%08lx", IPOD_HW_REVISION); |
655 | #endif | 644 | #endif |
656 | 645 | ||
657 | debug_printf(line++, "PP version: %s", pp_version); | 646 | lcd_putsf(0, line++, "PP version: %s", pp_version); |
658 | 647 | ||
659 | debug_printf(line++, "Est. clock (kHz): %d", perfcheck()); | 648 | lcd_putsf(0, line++, "Est. clock (kHz): %d", perfcheck()); |
660 | 649 | ||
661 | lcd_update(); | 650 | lcd_update(); |
662 | 651 | ||
@@ -706,12 +695,12 @@ static bool dbg_hw_info(void) | |||
706 | switch(currval) | 695 | switch(currval) |
707 | { | 696 | { |
708 | case 0: | 697 | case 0: |
709 | debug_printf(1, "ROM: %d.%02d", | 698 | lcd_putsf(0, 1, "ROM: %d.%02d", |
710 | rom_version/100, rom_version%100); | 699 | rom_version/100, rom_version%100); |
711 | break; | 700 | break; |
712 | case 1: | 701 | case 1: |
713 | if (got_id) | 702 | if (got_id) |
714 | debug_printf(1, "Flash:%02x,%02x", manu, id); | 703 | lcd_putsf(0, 1, "Flash:%02x,%02x", manu, id); |
715 | else | 704 | else |
716 | lcd_puts(0, 1, "Flash:??,??"); /* unknown, sorry */ | 705 | lcd_puts(0, 1, "Flash:??,??"); /* unknown, sorry */ |
717 | break; | 706 | break; |
@@ -724,7 +713,7 @@ static bool dbg_hw_info(void) | |||
724 | lcd_puts(0, 1, "BootROM: V2"); | 713 | lcd_puts(0, 1, "BootROM: V2"); |
725 | /* alternative boot ROM found in one single player so far */ | 714 | /* alternative boot ROM found in one single player so far */ |
726 | else | 715 | else |
727 | debug_printf(1, "R: %08x", rom_crc); | 716 | lcd_putsf(0, 1, "R: %08x", rom_crc); |
728 | } | 717 | } |
729 | else | 718 | else |
730 | lcd_puts(0, 1, "BootROM: no"); | 719 | lcd_puts(0, 1, "BootROM: no"); |
@@ -822,25 +811,25 @@ static bool dbg_spdif(void) | |||
822 | symbolerr = (interruptstat & 0x00800000)?true:false; | 811 | symbolerr = (interruptstat & 0x00800000)?true:false; |
823 | parityerr = (interruptstat & 0x00400000)?true:false; | 812 | parityerr = (interruptstat & 0x00400000)?true:false; |
824 | 813 | ||
825 | debug_printf(line++, "Val: %s Sym: %s Par: %s", | 814 | lcd_putsf(0, line++, "Val: %s Sym: %s Par: %s", |
826 | valnogood?"--":"OK", | 815 | valnogood?"--":"OK", |
827 | symbolerr?"--":"OK", | 816 | symbolerr?"--":"OK", |
828 | parityerr?"--":"OK"); | 817 | parityerr?"--":"OK"); |
829 | 818 | ||
830 | debug_printf(line++, "Status word: %08x", (int)control); | 819 | lcd_putsf(0, line++, "Status word: %08x", (int)control); |
831 | 820 | ||
832 | line++; | 821 | line++; |
833 | 822 | ||
834 | x = control >> 31; | 823 | x = control >> 31; |
835 | debug_printf(line++, "PRO: %d (%s)", | 824 | lcd_putsf(0, line++, "PRO: %d (%s)", |
836 | x, x?"Professional":"Consumer"); | 825 | x, x?"Professional":"Consumer"); |
837 | 826 | ||
838 | x = (control >> 30) & 1; | 827 | x = (control >> 30) & 1; |
839 | debug_printf(line++, "Audio: %d (%s)", | 828 | lcd_putsf(0, line++, "Audio: %d (%s)", |
840 | x, x?"Non-PCM":"PCM"); | 829 | x, x?"Non-PCM":"PCM"); |
841 | 830 | ||
842 | x = (control >> 29) & 1; | 831 | x = (control >> 29) & 1; |
843 | debug_printf(line++, "Copy: %d (%s)", | 832 | lcd_putsf(0, line++, "Copy: %d (%s)", |
844 | x, x?"Permitted":"Inhibited"); | 833 | x, x?"Permitted":"Inhibited"); |
845 | 834 | ||
846 | x = (control >> 27) & 7; | 835 | x = (control >> 27) & 7; |
@@ -856,10 +845,10 @@ static bool dbg_spdif(void) | |||
856 | s = "Reserved"; | 845 | s = "Reserved"; |
857 | break; | 846 | break; |
858 | } | 847 | } |
859 | debug_printf(line++, "Preemphasis: %d (%s)", x, s); | 848 | lcd_putsf(0, line++, "Preemphasis: %d (%s)", x, s); |
860 | 849 | ||
861 | x = (control >> 24) & 3; | 850 | x = (control >> 24) & 3; |
862 | debug_printf(line++, "Mode: %d", x); | 851 | lcd_putsf(0, line++, "Mode: %d", x); |
863 | 852 | ||
864 | category = (control >> 17) & 127; | 853 | category = (control >> 17) & 127; |
865 | switch(category) | 854 | switch(category) |
@@ -873,7 +862,7 @@ static bool dbg_spdif(void) | |||
873 | default: | 862 | default: |
874 | s = "Unknown"; | 863 | s = "Unknown"; |
875 | } | 864 | } |
876 | debug_printf(line++, "Category: 0x%02x (%s)", category, s); | 865 | lcd_putsf(0, line++, "Category: 0x%02x (%s)", category, s); |
877 | 866 | ||
878 | x = (control >> 16) & 1; | 867 | x = (control >> 16) & 1; |
879 | generation = x; | 868 | generation = x; |
@@ -883,11 +872,11 @@ static bool dbg_spdif(void) | |||
883 | { | 872 | { |
884 | generation = !generation; | 873 | generation = !generation; |
885 | } | 874 | } |
886 | debug_printf(line++, "Generation: %d (%s)", | 875 | lcd_putsf(0, line++, "Generation: %d (%s)", |
887 | x, generation?"Original":"No ind."); | 876 | x, generation?"Original":"No ind."); |
888 | 877 | ||
889 | x = (control >> 12) & 15; | 878 | x = (control >> 12) & 15; |
890 | debug_printf(line++, "Source: %d", x); | 879 | lcd_putsf(0, line++, "Source: %d", x); |
891 | 880 | ||
892 | 881 | ||
893 | x = (control >> 8) & 15; | 882 | x = (control >> 8) & 15; |
@@ -906,7 +895,7 @@ static bool dbg_spdif(void) | |||
906 | s = ""; | 895 | s = ""; |
907 | break; | 896 | break; |
908 | } | 897 | } |
909 | debug_printf(line++, "Channel: %d (%s)", x, s); | 898 | lcd_putsf(0, line++, "Channel: %d (%s)", x, s); |
910 | 899 | ||
911 | x = (control >> 4) & 15; | 900 | x = (control >> 4) & 15; |
912 | switch(x) | 901 | switch(x) |
@@ -921,14 +910,14 @@ static bool dbg_spdif(void) | |||
921 | s = "32kHz"; | 910 | s = "32kHz"; |
922 | break; | 911 | break; |
923 | } | 912 | } |
924 | debug_printf(line++, "Frequency: %d (%s)", x, s); | 913 | lcd_putsf(0, line++, "Frequency: %d (%s)", x, s); |
925 | 914 | ||
926 | x = (control >> 2) & 3; | 915 | x = (control >> 2) & 3; |
927 | debug_printf(line++, "Clock accuracy: %d", x); | 916 | lcd_putsf(0, line++, "Clock accuracy: %d", x); |
928 | line++; | 917 | line++; |
929 | 918 | ||
930 | #ifndef SIMULATOR | 919 | #ifndef SIMULATOR |
931 | debug_printf(line++, "Measured freq: %ldHz", | 920 | lcd_putsf(0, line++, "Measured freq: %ldHz", |
932 | spdif_measure_frequency()); | 921 | spdif_measure_frequency()); |
933 | #endif | 922 | #endif |
934 | 923 | ||
@@ -1008,16 +997,16 @@ bool dbg_ports(void) | |||
1008 | 997 | ||
1009 | while(1) | 998 | while(1) |
1010 | { | 999 | { |
1011 | debug_printf(0, "PADR: %04x", (unsigned short)PADR); | 1000 | lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR); |
1012 | debug_printf(1, "PBDR: %04x", (unsigned short)PBDR); | 1001 | lcd_putsf(0, 1, "PBDR: %04x", (unsigned short)PBDR); |
1013 | 1002 | ||
1014 | debug_printf(2, "AN0: %03x AN4: %03x", adc_read(0), adc_read(4)); | 1003 | lcd_putsf(0, 2, "AN0: %03x AN4: %03x", adc_read(0), adc_read(4)); |
1015 | debug_printf(3, "AN1: %03x AN5: %03x", adc_read(1), adc_read(5)); | 1004 | lcd_putsf(0, 3, "AN1: %03x AN5: %03x", adc_read(1), adc_read(5)); |
1016 | debug_printf(4, "AN2: %03x AN6: %03x", adc_read(2), adc_read(6)); | 1005 | lcd_putsf(0, 4, "AN2: %03x AN6: %03x", adc_read(2), adc_read(6)); |
1017 | debug_printf(5, "AN3: %03x AN7: %03x", adc_read(3), adc_read(7)); | 1006 | lcd_putsf(0, 5, "AN3: %03x AN7: %03x", adc_read(3), adc_read(7)); |
1018 | 1007 | ||
1019 | battery_read_info(&adc_battery_voltage, &adc_battery_level); | 1008 | battery_read_info(&adc_battery_voltage, &adc_battery_level); |
1020 | debug_printf(6, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, | 1009 | lcd_putsf(0, 6, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, |
1021 | adc_battery_voltage % 1000, adc_battery_level); | 1010 | adc_battery_voltage % 1000, adc_battery_level); |
1022 | 1011 | ||
1023 | lcd_update(); | 1012 | lcd_update(); |
@@ -1055,41 +1044,41 @@ bool dbg_ports(void) | |||
1055 | gpio_enable = GPIO_ENABLE; | 1044 | gpio_enable = GPIO_ENABLE; |
1056 | gpio1_enable = GPIO1_ENABLE; | 1045 | gpio1_enable = GPIO1_ENABLE; |
1057 | 1046 | ||
1058 | debug_printf(line++, "GPIO_READ: %08x", gpio_read); | 1047 | lcd_putsf(0, line++, "GPIO_READ: %08x", gpio_read); |
1059 | debug_printf(line++, "GPIO_OUT: %08x", gpio_out); | 1048 | lcd_putsf(0, line++, "GPIO_OUT: %08x", gpio_out); |
1060 | debug_printf(line++, "GPIO_FUNC: %08x", gpio_function); | 1049 | lcd_putsf(0, line++, "GPIO_FUNC: %08x", gpio_function); |
1061 | debug_printf(line++, "GPIO_ENA: %08x", gpio_enable); | 1050 | lcd_putsf(0, line++, "GPIO_ENA: %08x", gpio_enable); |
1062 | 1051 | ||
1063 | debug_printf(line++, "GPIO1_READ: %08x", gpio1_read); | 1052 | lcd_putsf(0, line++, "GPIO1_READ: %08x", gpio1_read); |
1064 | debug_printf(line++, "GPIO1_OUT: %08x", gpio1_out); | 1053 | lcd_putsf(0, line++, "GPIO1_OUT: %08x", gpio1_out); |
1065 | debug_printf(line++, "GPIO1_FUNC: %08x", gpio1_function); | 1054 | lcd_putsf(0, line++, "GPIO1_FUNC: %08x", gpio1_function); |
1066 | debug_printf(line++, "GPIO1_ENA: %08x", gpio1_enable); | 1055 | lcd_putsf(0, line++, "GPIO1_ENA: %08x", gpio1_enable); |
1067 | 1056 | ||
1068 | adc_buttons = adc_read(ADC_BUTTONS); | 1057 | adc_buttons = adc_read(ADC_BUTTONS); |
1069 | adc_remote = adc_read(ADC_REMOTE); | 1058 | adc_remote = adc_read(ADC_REMOTE); |
1070 | battery_read_info(&adc_battery_voltage, &adc_battery_level); | 1059 | battery_read_info(&adc_battery_voltage, &adc_battery_level); |
1071 | #if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IRIVER_H300_SERIES) | 1060 | #if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IRIVER_H300_SERIES) |
1072 | debug_printf(line++, "ADC_BUTTONS (%c): %02x", | 1061 | lcd_putsf(0, line++, "ADC_BUTTONS (%c): %02x", |
1073 | button_scan_enabled() ? '+' : '-', adc_buttons); | 1062 | button_scan_enabled() ? '+' : '-', adc_buttons); |
1074 | #else | 1063 | #else |
1075 | debug_printf(line++, "ADC_BUTTONS: %02x", adc_buttons); | 1064 | lcd_putsf(0, line++, "ADC_BUTTONS: %02x", adc_buttons); |
1076 | #endif | 1065 | #endif |
1077 | #if defined(IAUDIO_X5) || defined(IAUDIO_M5) | 1066 | #if defined(IAUDIO_X5) || defined(IAUDIO_M5) |
1078 | debug_printf(line++, "ADC_REMOTE (%c): %02x", | 1067 | lcd_putsf(0, line++, "ADC_REMOTE (%c): %02x", |
1079 | remote_detect() ? '+' : '-', adc_remote); | 1068 | remote_detect() ? '+' : '-', adc_remote); |
1080 | #else | 1069 | #else |
1081 | debug_printf(line++, "ADC_REMOTE: %02x", adc_remote); | 1070 | lcd_putsf(0, line++, "ADC_REMOTE: %02x", adc_remote); |
1082 | #endif | 1071 | #endif |
1083 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) | 1072 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
1084 | debug_printf(line++, "ADC_REMOTEDETECT: %02x", | 1073 | lcd_putsf(0, line++, "ADC_REMOTEDETECT: %02x", |
1085 | adc_read(ADC_REMOTEDETECT)); | 1074 | adc_read(ADC_REMOTEDETECT)); |
1086 | #endif | 1075 | #endif |
1087 | 1076 | ||
1088 | debug_printf(line++, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, | 1077 | lcd_putsf(0, line++, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000, |
1089 | adc_battery_voltage % 1000, adc_battery_level); | 1078 | adc_battery_voltage % 1000, adc_battery_level); |
1090 | 1079 | ||
1091 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) | 1080 | #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) |
1092 | debug_printf(line++, "remotetype: %d", remote_type()); | 1081 | lcd_putsf(0, line++, "remotetype: %d", remote_type()); |
1093 | #endif | 1082 | #endif |
1094 | 1083 | ||
1095 | lcd_update(); | 1084 | lcd_update(); |
@@ -1110,66 +1099,66 @@ bool dbg_ports(void) | |||
1110 | { | 1099 | { |
1111 | line = 0; | 1100 | line = 0; |
1112 | lcd_puts(0, line++, "GPIO STATES:"); | 1101 | lcd_puts(0, line++, "GPIO STATES:"); |
1113 | debug_printf(line++, "A: %02x E: %02x I: %02x", | 1102 | lcd_putsf(0, line++, "A: %02x E: %02x I: %02x", |
1114 | (unsigned int)GPIOA_INPUT_VAL, | 1103 | (unsigned int)GPIOA_INPUT_VAL, |
1115 | (unsigned int)GPIOE_INPUT_VAL, | 1104 | (unsigned int)GPIOE_INPUT_VAL, |
1116 | (unsigned int)GPIOI_INPUT_VAL); | 1105 | (unsigned int)GPIOI_INPUT_VAL); |
1117 | debug_printf(line++, "B: %02x F: %02x J: %02x", | 1106 | lcd_putsf(0, line++, "B: %02x F: %02x J: %02x", |
1118 | (unsigned int)GPIOB_INPUT_VAL, | 1107 | (unsigned int)GPIOB_INPUT_VAL, |
1119 | (unsigned int)GPIOF_INPUT_VAL, | 1108 | (unsigned int)GPIOF_INPUT_VAL, |
1120 | (unsigned int)GPIOJ_INPUT_VAL); | 1109 | (unsigned int)GPIOJ_INPUT_VAL); |
1121 | debug_printf(line++, "C: %02x G: %02x K: %02x", | 1110 | lcd_putsf(0, line++, "C: %02x G: %02x K: %02x", |
1122 | (unsigned int)GPIOC_INPUT_VAL, | 1111 | (unsigned int)GPIOC_INPUT_VAL, |
1123 | (unsigned int)GPIOG_INPUT_VAL, | 1112 | (unsigned int)GPIOG_INPUT_VAL, |
1124 | (unsigned int)GPIOK_INPUT_VAL); | 1113 | (unsigned int)GPIOK_INPUT_VAL); |
1125 | debug_printf(line++, "D: %02x H: %02x L: %02x", | 1114 | lcd_putsf(0, line++, "D: %02x H: %02x L: %02x", |
1126 | (unsigned int)GPIOD_INPUT_VAL, | 1115 | (unsigned int)GPIOD_INPUT_VAL, |
1127 | (unsigned int)GPIOH_INPUT_VAL, | 1116 | (unsigned int)GPIOH_INPUT_VAL, |
1128 | (unsigned int)GPIOL_INPUT_VAL); | 1117 | (unsigned int)GPIOL_INPUT_VAL); |
1129 | line++; | 1118 | line++; |
1130 | debug_printf(line++, "GPO32_VAL: %08lx", GPO32_VAL); | 1119 | lcd_putsf(0, line++, "GPO32_VAL: %08lx", GPO32_VAL); |
1131 | debug_printf(line++, "GPO32_EN: %08lx", GPO32_ENABLE); | 1120 | lcd_putsf(0, line++, "GPO32_EN: %08lx", GPO32_ENABLE); |
1132 | debug_printf(line++, "DEV_EN: %08lx", DEV_EN); | 1121 | lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); |
1133 | debug_printf(line++, "DEV_EN2: %08lx", DEV_EN2); | 1122 | lcd_putsf(0, line++, "DEV_EN2: %08lx", DEV_EN2); |
1134 | debug_printf(line++, "DEV_EN3: %08lx", inl(0x60006044)); /* to be verified */ | 1123 | lcd_putsf(0, line++, "DEV_EN3: %08lx", inl(0x60006044)); /* to be verified */ |
1135 | debug_printf(line++, "DEV_INIT1: %08lx", DEV_INIT1); | 1124 | lcd_putsf(0, line++, "DEV_INIT1: %08lx", DEV_INIT1); |
1136 | debug_printf(line++, "DEV_INIT2: %08lx", DEV_INIT2); | 1125 | lcd_putsf(0, line++, "DEV_INIT2: %08lx", DEV_INIT2); |
1137 | #ifdef ADC_ACCESSORY | 1126 | #ifdef ADC_ACCESSORY |
1138 | debug_printf(line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); | 1127 | lcd_putsf(0, line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY)); |
1139 | #endif | 1128 | #endif |
1140 | 1129 | ||
1141 | #if defined(IPOD_ACCESSORY_PROTOCOL) | 1130 | #if defined(IPOD_ACCESSORY_PROTOCOL) |
1142 | extern unsigned char serbuf[]; | 1131 | extern unsigned char serbuf[]; |
1143 | debug_printf(line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", | 1132 | lcd_putsf(0, line++, "IAP PACKET: %02x %02x %02x %02x %02x %02x %02x %02x", |
1144 | serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], | 1133 | serbuf[0], serbuf[1], serbuf[2], serbuf[3], serbuf[4], serbuf[5], |
1145 | serbuf[6], serbuf[7]); | 1134 | serbuf[6], serbuf[7]); |
1146 | #endif | 1135 | #endif |
1147 | 1136 | ||
1148 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) | 1137 | #if defined(IRIVER_H10) || defined(IRIVER_H10_5GB) |
1149 | line++; | 1138 | line++; |
1150 | debug_printf(line++, "BATT: %03x UNK1: %03x", | 1139 | lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", |
1151 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); | 1140 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); |
1152 | debug_printf(line++, "REM: %03x PAD: %03x", | 1141 | lcd_putsf(0, line++, "REM: %03x PAD: %03x", |
1153 | adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); | 1142 | adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); |
1154 | #elif defined(PHILIPS_HDD1630) | 1143 | #elif defined(PHILIPS_HDD1630) |
1155 | line++; | 1144 | line++; |
1156 | debug_printf(line++, "BATT: %03x UNK1: %03x", | 1145 | lcd_putsf(0, line++, "BATT: %03x UNK1: %03x", |
1157 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); | 1146 | adc_read(ADC_BATTERY), adc_read(ADC_UNKNOWN_1)); |
1158 | #elif defined(SANSA_E200) || defined(PHILIPS_SA9200) | 1147 | #elif defined(SANSA_E200) || defined(PHILIPS_SA9200) |
1159 | debug_printf(line++, "ADC_BVDD: %4d", adc_read(ADC_BVDD)); | 1148 | lcd_putsf(0, line++, "ADC_BVDD: %4d", adc_read(ADC_BVDD)); |
1160 | debug_printf(line++, "ADC_RTCSUP: %4d", adc_read(ADC_RTCSUP)); | 1149 | lcd_putsf(0, line++, "ADC_RTCSUP: %4d", adc_read(ADC_RTCSUP)); |
1161 | debug_printf(line++, "ADC_UVDD: %4d", adc_read(ADC_UVDD)); | 1150 | lcd_putsf(0, line++, "ADC_UVDD: %4d", adc_read(ADC_UVDD)); |
1162 | debug_printf(line++, "ADC_CHG_IN: %4d", adc_read(ADC_CHG_IN)); | 1151 | lcd_putsf(0, line++, "ADC_CHG_IN: %4d", adc_read(ADC_CHG_IN)); |
1163 | debug_printf(line++, "ADC_CVDD: %4d", adc_read(ADC_CVDD)); | 1152 | lcd_putsf(0, line++, "ADC_CVDD: %4d", adc_read(ADC_CVDD)); |
1164 | debug_printf(line++, "ADC_BATTEMP: %4d", adc_read(ADC_BATTEMP)); | 1153 | lcd_putsf(0, line++, "ADC_BATTEMP: %4d", adc_read(ADC_BATTEMP)); |
1165 | debug_printf(line++, "ADC_MICSUP1: %4d", adc_read(ADC_MICSUP1)); | 1154 | lcd_putsf(0, line++, "ADC_MICSUP1: %4d", adc_read(ADC_MICSUP1)); |
1166 | debug_printf(line++, "ADC_MICSUP2: %4d", adc_read(ADC_MICSUP2)); | 1155 | lcd_putsf(0, line++, "ADC_MICSUP2: %4d", adc_read(ADC_MICSUP2)); |
1167 | debug_printf(line++, "ADC_VBE1: %4d", adc_read(ADC_VBE1)); | 1156 | lcd_putsf(0, line++, "ADC_VBE1: %4d", adc_read(ADC_VBE1)); |
1168 | debug_printf(line++, "ADC_VBE2: %4d", adc_read(ADC_VBE2)); | 1157 | lcd_putsf(0, line++, "ADC_VBE2: %4d", adc_read(ADC_VBE2)); |
1169 | debug_printf(line++, "ADC_I_MICSUP1:%4d", adc_read(ADC_I_MICSUP1)); | 1158 | lcd_putsf(0, line++, "ADC_I_MICSUP1:%4d", adc_read(ADC_I_MICSUP1)); |
1170 | #if !defined(PHILIPS_SA9200) | 1159 | #if !defined(PHILIPS_SA9200) |
1171 | debug_printf(line++, "ADC_I_MICSUP2:%4d", adc_read(ADC_I_MICSUP2)); | 1160 | lcd_putsf(0, line++, "ADC_I_MICSUP2:%4d", adc_read(ADC_I_MICSUP2)); |
1172 | debug_printf(line++, "ADC_VBAT: %4d", adc_read(ADC_VBAT)); | 1161 | lcd_putsf(0, line++, "ADC_VBAT: %4d", adc_read(ADC_VBAT)); |
1173 | #endif | 1162 | #endif |
1174 | #endif | 1163 | #endif |
1175 | lcd_update(); | 1164 | lcd_update(); |
@@ -1189,19 +1178,19 @@ extern unsigned char serbuf[]; | |||
1189 | while(1) | 1178 | while(1) |
1190 | { | 1179 | { |
1191 | line = 0; | 1180 | line = 0; |
1192 | debug_printf(line++, "GPIO_A: %02x GPIO_B: %02x", | 1181 | lcd_putsf(0, line++, "GPIO_A: %02x GPIO_B: %02x", |
1193 | (unsigned int)GPIOA_INPUT_VAL, (unsigned int)GPIOB_INPUT_VAL); | 1182 | (unsigned int)GPIOA_INPUT_VAL, (unsigned int)GPIOB_INPUT_VAL); |
1194 | debug_printf(line++, "GPIO_C: %02x GPIO_D: %02x", | 1183 | lcd_putsf(0, line++, "GPIO_C: %02x GPIO_D: %02x", |
1195 | (unsigned int)GPIOC_INPUT_VAL, (unsigned int)GPIOD_INPUT_VAL); | 1184 | (unsigned int)GPIOC_INPUT_VAL, (unsigned int)GPIOD_INPUT_VAL); |
1196 | 1185 | ||
1197 | debug_printf(line++, "DEV_EN: %08lx", DEV_EN); | 1186 | lcd_putsf(0, line++, "DEV_EN: %08lx", DEV_EN); |
1198 | debug_printf(line++, "CLOCK_ENABLE: %08lx", CLOCK_ENABLE); | 1187 | lcd_putsf(0, line++, "CLOCK_ENABLE: %08lx", CLOCK_ENABLE); |
1199 | debug_printf(line++, "CLOCK_SOURCE: %08lx", CLOCK_SOURCE); | 1188 | lcd_putsf(0, line++, "CLOCK_SOURCE: %08lx", CLOCK_SOURCE); |
1200 | debug_printf(line++, "PLL_CONTROL: %08lx", PLL_CONTROL); | 1189 | lcd_putsf(0, line++, "PLL_CONTROL: %08lx", PLL_CONTROL); |
1201 | debug_printf(line++, "PLL_DIV: %08lx", PLL_DIV); | 1190 | lcd_putsf(0, line++, "PLL_DIV: %08lx", PLL_DIV); |
1202 | debug_printf(line++, "PLL_MULT: %08lx", PLL_MULT); | 1191 | lcd_putsf(0, line++, "PLL_MULT: %08lx", PLL_MULT); |
1203 | debug_printf(line++, "TIMING1_CTL: %08lx", TIMING1_CTL); | 1192 | lcd_putsf(0, line++, "TIMING1_CTL: %08lx", TIMING1_CTL); |
1204 | debug_printf(line++, "TIMING2_CTL: %08lx", TIMING2_CTL); | 1193 | lcd_putsf(0, line++, "TIMING2_CTL: %08lx", TIMING2_CTL); |
1205 | 1194 | ||
1206 | lcd_update(); | 1195 | lcd_update(); |
1207 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 1196 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
@@ -1264,7 +1253,7 @@ bool dbg_ports(void) | |||
1264 | lcd_puts(0, 0, buf); | 1253 | lcd_puts(0, 0, buf); |
1265 | 1254 | ||
1266 | battery_read_info(&adc_battery_voltage, NULL); | 1255 | battery_read_info(&adc_battery_voltage, NULL); |
1267 | debug_printf(1, "Batt: %d.%03dV", adc_battery_voltage / 1000, | 1256 | lcd_putsf(0, 1, "Batt: %d.%03dV", adc_battery_voltage / 1000, |
1268 | adc_battery_voltage % 1000); | 1257 | adc_battery_voltage % 1000); |
1269 | lcd_update(); | 1258 | lcd_update(); |
1270 | 1259 | ||
@@ -1307,19 +1296,19 @@ static bool dbg_pcf(void) | |||
1307 | { | 1296 | { |
1308 | line = 0; | 1297 | line = 0; |
1309 | 1298 | ||
1310 | debug_printf(line++, "DCDC1: %02x", pcf50605_read(0x1b)); | 1299 | lcd_putsf(0, line++, "DCDC1: %02x", pcf50605_read(0x1b)); |
1311 | debug_printf(line++, "DCDC2: %02x", pcf50605_read(0x1c)); | 1300 | lcd_putsf(0, line++, "DCDC2: %02x", pcf50605_read(0x1c)); |
1312 | debug_printf(line++, "DCDC3: %02x", pcf50605_read(0x1d)); | 1301 | lcd_putsf(0, line++, "DCDC3: %02x", pcf50605_read(0x1d)); |
1313 | debug_printf(line++, "DCDC4: %02x", pcf50605_read(0x1e)); | 1302 | lcd_putsf(0, line++, "DCDC4: %02x", pcf50605_read(0x1e)); |
1314 | debug_printf(line++, "DCDEC1: %02x", pcf50605_read(0x1f)); | 1303 | lcd_putsf(0, line++, "DCDEC1: %02x", pcf50605_read(0x1f)); |
1315 | debug_printf(line++, "DCDEC2: %02x", pcf50605_read(0x20)); | 1304 | lcd_putsf(0, line++, "DCDEC2: %02x", pcf50605_read(0x20)); |
1316 | debug_printf(line++, "DCUDC1: %02x", pcf50605_read(0x21)); | 1305 | lcd_putsf(0, line++, "DCUDC1: %02x", pcf50605_read(0x21)); |
1317 | debug_printf(line++, "DCUDC2: %02x", pcf50605_read(0x22)); | 1306 | lcd_putsf(0, line++, "DCUDC2: %02x", pcf50605_read(0x22)); |
1318 | debug_printf(line++, "IOREGC: %02x", pcf50605_read(0x23)); | 1307 | lcd_putsf(0, line++, "IOREGC: %02x", pcf50605_read(0x23)); |
1319 | debug_printf(line++, "D1REGC: %02x", pcf50605_read(0x24)); | 1308 | lcd_putsf(0, line++, "D1REGC: %02x", pcf50605_read(0x24)); |
1320 | debug_printf(line++, "D2REGC: %02x", pcf50605_read(0x25)); | 1309 | lcd_putsf(0, line++, "D2REGC: %02x", pcf50605_read(0x25)); |
1321 | debug_printf(line++, "D3REGC: %02x", pcf50605_read(0x26)); | 1310 | lcd_putsf(0, line++, "D3REGC: %02x", pcf50605_read(0x26)); |
1322 | debug_printf(line++, "LPREG1: %02x", pcf50605_read(0x27)); | 1311 | lcd_putsf(0, line++, "LPREG1: %02x", pcf50605_read(0x27)); |
1323 | lcd_update(); | 1312 | lcd_update(); |
1324 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 1313 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
1325 | { | 1314 | { |
@@ -1348,8 +1337,8 @@ static bool dbg_cpufreq(void) | |||
1348 | { | 1337 | { |
1349 | line = 0; | 1338 | line = 0; |
1350 | 1339 | ||
1351 | debug_printf(line++, "Frequency: %ld", FREQ); | 1340 | lcd_putsf(0, line++, "Frequency: %ld", FREQ); |
1352 | debug_printf(line++, "boost_counter: %d", get_cpu_boost_counter()); | 1341 | lcd_putsf(0, line++, "boost_counter: %d", get_cpu_boost_counter()); |
1353 | 1342 | ||
1354 | lcd_update(); | 1343 | lcd_update(); |
1355 | button = get_action(CONTEXT_STD,HZ/10); | 1344 | button = get_action(CONTEXT_STD,HZ/10); |
@@ -1484,9 +1473,9 @@ static bool view_battery(void) | |||
1484 | minv = power_history[i]; | 1473 | minv = power_history[i]; |
1485 | } | 1474 | } |
1486 | 1475 | ||
1487 | debug_printf(0, "Battery %d.%03d", power_history[0] / 1000, | 1476 | lcd_putsf(0, 0, "Battery %d.%03d", power_history[0] / 1000, |
1488 | power_history[0] % 1000); | 1477 | power_history[0] % 1000); |
1489 | debug_printf(1, "scale %d.%03d-%d.%03dV", | 1478 | lcd_putsf(0, 1, "scale %d.%03d-%d.%03dV", |
1490 | minv / 1000, minv % 1000, maxv / 1000, maxv % 1000); | 1479 | minv / 1000, minv % 1000, maxv / 1000, maxv % 1000); |
1491 | 1480 | ||
1492 | x = 0; | 1481 | x = 0; |
@@ -1506,23 +1495,23 @@ static bool view_battery(void) | |||
1506 | lcd_puts(0, 0, "Power status:"); | 1495 | lcd_puts(0, 0, "Power status:"); |
1507 | 1496 | ||
1508 | battery_read_info(&y, NULL); | 1497 | battery_read_info(&y, NULL); |
1509 | debug_printf(1, "Battery: %d.%03d V", y / 1000, y % 1000); | 1498 | lcd_putsf(0, 1, "Battery: %d.%03d V", y / 1000, y % 1000); |
1510 | #ifdef ADC_EXT_POWER | 1499 | #ifdef ADC_EXT_POWER |
1511 | y = (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 1000; | 1500 | y = (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 1000; |
1512 | debug_printf(2, "External: %d.%03d V", y / 1000, y % 1000); | 1501 | lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000); |
1513 | #endif | 1502 | #endif |
1514 | #if CONFIG_CHARGING | 1503 | #if CONFIG_CHARGING |
1515 | #if defined ARCHOS_RECORDER | 1504 | #if defined ARCHOS_RECORDER |
1516 | debug_printf(3, "Chgr: %s %s", | 1505 | lcd_putsf(0, 3, "Chgr: %s %s", |
1517 | charger_inserted() ? "present" : "absent", | 1506 | charger_inserted() ? "present" : "absent", |
1518 | charger_enabled() ? "on" : "off"); | 1507 | charger_enabled() ? "on" : "off"); |
1519 | debug_printf(5, "short delta: %d", short_delta); | 1508 | lcd_putsf(0, 5, "short delta: %d", short_delta); |
1520 | debug_printf(6, "long delta: %d", long_delta); | 1509 | lcd_putsf(0, 6, "long delta: %d", long_delta); |
1521 | lcd_puts(0, 7, power_message); | 1510 | lcd_puts(0, 7, power_message); |
1522 | debug_printf(8, "USB Inserted: %s", | 1511 | lcd_putsf(0, 8, "USB Inserted: %s", |
1523 | usb_inserted() ? "yes" : "no"); | 1512 | usb_inserted() ? "yes" : "no"); |
1524 | #elif defined IRIVER_H300_SERIES | 1513 | #elif defined IRIVER_H300_SERIES |
1525 | debug_printf(9, "USB Charging Enabled: %s", | 1514 | lcd_putsf(0, 9, "USB Charging Enabled: %s", |
1526 | usb_charging_enabled() ? "yes" : "no"); | 1515 | usb_charging_enabled() ? "yes" : "no"); |
1527 | #elif defined IPOD_NANO || defined IPOD_VIDEO | 1516 | #elif defined IPOD_NANO || defined IPOD_VIDEO |
1528 | int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; | 1517 | int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; |
@@ -1531,15 +1520,15 @@ static bool view_battery(void) | |||
1531 | int charging = (GPIOB_INPUT_VAL & 0x01)?false:true; | 1520 | int charging = (GPIOB_INPUT_VAL & 0x01)?false:true; |
1532 | int headphone= (GPIOA_INPUT_VAL & 0x80)?true:false; | 1521 | int headphone= (GPIOA_INPUT_VAL & 0x80)?true:false; |
1533 | 1522 | ||
1534 | debug_printf(3, "USB pwr: %s", | 1523 | lcd_putsf(0, 3, "USB pwr: %s", |
1535 | usb_pwr ? "present" : "absent"); | 1524 | usb_pwr ? "present" : "absent"); |
1536 | debug_printf(4, "EXT pwr: %s", | 1525 | lcd_putsf(0, 4, "EXT pwr: %s", |
1537 | ext_pwr ? "present" : "absent"); | 1526 | ext_pwr ? "present" : "absent"); |
1538 | debug_printf(5, "Battery: %s", | 1527 | lcd_putsf(0, 5, "Battery: %s", |
1539 | charging ? "charging" : (usb_pwr||ext_pwr) ? "charged" : "discharging"); | 1528 | charging ? "charging" : (usb_pwr||ext_pwr) ? "charged" : "discharging"); |
1540 | debug_printf(6, "Dock mode: %s", | 1529 | lcd_putsf(0, 6, "Dock mode: %s", |
1541 | dock ? "enabled" : "disabled"); | 1530 | dock ? "enabled" : "disabled"); |
1542 | debug_printf(7, "Headphone: %s", | 1531 | lcd_putsf(0, 7, "Headphone: %s", |
1543 | headphone ? "connected" : "disconnected"); | 1532 | headphone ? "connected" : "disconnected"); |
1544 | #elif defined TOSHIBA_GIGABEAT_S | 1533 | #elif defined TOSHIBA_GIGABEAT_S |
1545 | int line = 3; | 1534 | int line = 3; |
@@ -1556,16 +1545,16 @@ static bool view_battery(void) | |||
1556 | "<unknown>", | 1545 | "<unknown>", |
1557 | }; | 1546 | }; |
1558 | 1547 | ||
1559 | debug_printf(line++, "Charger: %s", | 1548 | lcd_putsf(0, line++, "Charger: %s", |
1560 | charger_inserted() ? "present" : "absent"); | 1549 | charger_inserted() ? "present" : "absent"); |
1561 | 1550 | ||
1562 | st = power_input_status() & | 1551 | st = power_input_status() & |
1563 | (POWER_INPUT_CHARGER | POWER_INPUT_BATTERY); | 1552 | (POWER_INPUT_CHARGER | POWER_INPUT_BATTERY); |
1564 | debug_printf(line++, "%s%s", | 1553 | lcd_putsf(0, line++, "%s%s", |
1565 | (st & POWER_INPUT_MAIN_CHARGER) ? " Main" : "", | 1554 | (st & POWER_INPUT_MAIN_CHARGER) ? " Main" : "", |
1566 | (st & POWER_INPUT_USB_CHARGER) ? " USB" : ""); | 1555 | (st & POWER_INPUT_USB_CHARGER) ? " USB" : ""); |
1567 | 1556 | ||
1568 | debug_printf(line++, "IUSB Max: %d", usb_allowed_current()); | 1557 | lcd_putsf(0, line++, "IUSB Max: %d", usb_allowed_current()); |
1569 | 1558 | ||
1570 | y = ARRAYLEN(chrgstate_strings) - 1; | 1559 | y = ARRAYLEN(chrgstate_strings) - 1; |
1571 | 1560 | ||
@@ -1580,36 +1569,36 @@ static bool view_battery(void) | |||
1580 | default:; | 1569 | default:; |
1581 | } | 1570 | } |
1582 | 1571 | ||
1583 | debug_printf(line++, "State: %s", chrgstate_strings[y]); | 1572 | lcd_putsf(0, line++, "State: %s", chrgstate_strings[y]); |
1584 | 1573 | ||
1585 | debug_printf(line++, "Battery Switch: %s", | 1574 | lcd_putsf(0, line++, "Battery Switch: %s", |
1586 | (st & POWER_INPUT_BATTERY) ? "On" : "Off"); | 1575 | (st & POWER_INPUT_BATTERY) ? "On" : "Off"); |
1587 | 1576 | ||
1588 | y = chrgraw_adc_voltage(); | 1577 | y = chrgraw_adc_voltage(); |
1589 | debug_printf(line++, "CHRGRAW: %d.%03d V", | 1578 | lcd_putsf(0, line++, "CHRGRAW: %d.%03d V", |
1590 | y / 1000, y % 1000); | 1579 | y / 1000, y % 1000); |
1591 | 1580 | ||
1592 | y = application_supply_adc_voltage(); | 1581 | y = application_supply_adc_voltage(); |
1593 | debug_printf(line++, "BP : %d.%03d V", | 1582 | lcd_putsf(0, line++, "BP : %d.%03d V", |
1594 | y / 1000, y % 1000); | 1583 | y / 1000, y % 1000); |
1595 | 1584 | ||
1596 | y = battery_adc_charge_current(); | 1585 | y = battery_adc_charge_current(); |
1597 | if (y < 0) x = '-', y = -y; | 1586 | if (y < 0) x = '-', y = -y; |
1598 | else x = ' '; | 1587 | else x = ' '; |
1599 | debug_printf(line++, "CHRGISN:%c%d mA", x, y); | 1588 | lcd_putsf(0, line++, "CHRGISN:%c%d mA", x, y); |
1600 | 1589 | ||
1601 | y = cccv_regulator_dissipation(); | 1590 | y = cccv_regulator_dissipation(); |
1602 | debug_printf(line++, "P CCCV : %d mW", y); | 1591 | lcd_putsf(0, line++, "P CCCV : %d mW", y); |
1603 | 1592 | ||
1604 | y = battery_charge_current(); | 1593 | y = battery_charge_current(); |
1605 | if (y < 0) x = '-', y = -y; | 1594 | if (y < 0) x = '-', y = -y; |
1606 | else x = ' '; | 1595 | else x = ' '; |
1607 | debug_printf(line++, "I Charge:%c%d mA", x, y); | 1596 | lcd_putsf(0, line++, "I Charge:%c%d mA", x, y); |
1608 | 1597 | ||
1609 | y = battery_adc_temp(); | 1598 | y = battery_adc_temp(); |
1610 | 1599 | ||
1611 | if (y != INT_MIN) { | 1600 | if (y != INT_MIN) { |
1612 | debug_printf(line++, "T Battery: %dC (%dF)", y, | 1601 | lcd_putsf(0, line++, "T Battery: %dC (%dF)", y, |
1613 | (9*y + 160) / 5); | 1602 | (9*y + 160) / 5); |
1614 | } else { | 1603 | } else { |
1615 | /* Conversion disabled */ | 1604 | /* Conversion disabled */ |
@@ -1627,23 +1616,23 @@ static bool view_battery(void) | |||
1627 | }; | 1616 | }; |
1628 | const char *str = NULL; | 1617 | const char *str = NULL; |
1629 | 1618 | ||
1630 | debug_printf(3, "Charger: %s", | 1619 | lcd_putsf(0, 3, "Charger: %s", |
1631 | charger_inserted() ? "present" : "absent"); | 1620 | charger_inserted() ? "present" : "absent"); |
1632 | 1621 | ||
1633 | y = charge_state - first; | 1622 | y = charge_state - first; |
1634 | if ((unsigned)y < ARRAYLEN(chrgstate_strings)) | 1623 | if ((unsigned)y < ARRAYLEN(chrgstate_strings)) |
1635 | str = chrgstate_strings[y]; | 1624 | str = chrgstate_strings[y]; |
1636 | 1625 | ||
1637 | debug_printf(4, "State: %s", | 1626 | lcd_putsf(0, 4, "State: %s", |
1638 | str ? str : "<unknown>"); | 1627 | str ? str : "<unknown>"); |
1639 | 1628 | ||
1640 | debug_printf(5, "CHARGER: %02X", | 1629 | lcd_putsf(0, 5, "CHARGER: %02X", |
1641 | ascodec_read(AS3514_CHARGER)); | 1630 | ascodec_read(AS3514_CHARGER)); |
1642 | #elif defined(IPOD_NANO2G) | 1631 | #elif defined(IPOD_NANO2G) |
1643 | y = pmu_read_battery_current(); | 1632 | y = pmu_read_battery_current(); |
1644 | debug_printf(2, "Battery current: %d mA", y); | 1633 | lcd_putsf(0, 2, "Battery current: %d mA", y); |
1645 | #else | 1634 | #else |
1646 | debug_printf(3, "Charger: %s", | 1635 | lcd_putsf(0, 3, "Charger: %s", |
1647 | charger_inserted() ? "present" : "absent"); | 1636 | charger_inserted() ? "present" : "absent"); |
1648 | #endif /* target type */ | 1637 | #endif /* target type */ |
1649 | #endif /* CONFIG_CHARGING */ | 1638 | #endif /* CONFIG_CHARGING */ |
@@ -1654,7 +1643,7 @@ static bool view_battery(void) | |||
1654 | 1643 | ||
1655 | for (i = 0; i <= 6; i++) { | 1644 | for (i = 0; i <= 6; i++) { |
1656 | y = power_history[i] - power_history[i+1]; | 1645 | y = power_history[i] - power_history[i+1]; |
1657 | debug_printf(i+1, "-%d min: %s%d.%03d V", i, | 1646 | lcd_putsf(0, i+1, "-%d min: %s%d.%03d V", i, |
1658 | (y < 0) ? "-" : "", ((y < 0) ? y * -1 : y) / 1000, | 1647 | (y < 0) ? "-" : "", ((y < 0) ? y * -1 : y) / 1000, |
1659 | ((y < 0) ? y * -1 : y ) % 1000); | 1648 | ((y < 0) ? y * -1 : y ) % 1000); |
1660 | } | 1649 | } |
@@ -1663,24 +1652,24 @@ static bool view_battery(void) | |||
1663 | case 3: /* remaining time estimation: */ | 1652 | case 3: /* remaining time estimation: */ |
1664 | 1653 | ||
1665 | #ifdef ARCHOS_RECORDER | 1654 | #ifdef ARCHOS_RECORDER |
1666 | debug_printf(0, "charge_state: %d", charge_state); | 1655 | lcd_putsf(0, 0, "charge_state: %d", charge_state); |
1667 | 1656 | ||
1668 | debug_printf(1, "Cycle time: %d m", powermgmt_last_cycle_startstop_min); | 1657 | lcd_putsf(0, 1, "Cycle time: %d m", powermgmt_last_cycle_startstop_min); |
1669 | 1658 | ||
1670 | debug_printf(2, "Lvl@cyc st: %d%%", powermgmt_last_cycle_level); | 1659 | lcd_putsf(0, 2, "Lvl@cyc st: %d%%", powermgmt_last_cycle_level); |
1671 | 1660 | ||
1672 | debug_printf(3, "P=%2d I=%2d", pid_p, pid_i); | 1661 | lcd_putsf(0, 3, "P=%2d I=%2d", pid_p, pid_i); |
1673 | 1662 | ||
1674 | debug_printf(4, "Trickle sec: %d/60", trickle_sec); | 1663 | lcd_putsf(0, 4, "Trickle sec: %d/60", trickle_sec); |
1675 | #endif /* ARCHOS_RECORDER */ | 1664 | #endif /* ARCHOS_RECORDER */ |
1676 | 1665 | ||
1677 | debug_printf(5, "Last PwrHist: %d.%03dV", | 1666 | lcd_putsf(0, 5, "Last PwrHist: %d.%03dV", |
1678 | power_history[0] / 1000, | 1667 | power_history[0] / 1000, |
1679 | power_history[0] % 1000); | 1668 | power_history[0] % 1000); |
1680 | 1669 | ||
1681 | debug_printf(6, "battery level: %d%%", battery_level()); | 1670 | lcd_putsf(0, 6, "battery level: %d%%", battery_level()); |
1682 | 1671 | ||
1683 | debug_printf(7, "Est. remain: %d m", battery_time()); | 1672 | lcd_putsf(0, 7, "Est. remain: %d m", battery_time()); |
1684 | break; | 1673 | break; |
1685 | } | 1674 | } |
1686 | 1675 | ||
@@ -2447,16 +2436,16 @@ static bool dbg_scrollwheel(void) | |||
2447 | lcd_clear_display(); | 2436 | lcd_clear_display(); |
2448 | 2437 | ||
2449 | /* show internal variables of scrollwheel driver */ | 2438 | /* show internal variables of scrollwheel driver */ |
2450 | debug_printf(0, "wheel touched: %s", (wheel_is_touched) ? "true" : "false"); | 2439 | lcd_putsf(0, 0, "wheel touched: %s", (wheel_is_touched) ? "true" : "false"); |
2451 | debug_printf(1, "new position: %2d", new_wheel_value); | 2440 | lcd_putsf(0, 1, "new position: %2d", new_wheel_value); |
2452 | debug_printf(2, "old position: %2d", old_wheel_value); | 2441 | lcd_putsf(0, 2, "old position: %2d", old_wheel_value); |
2453 | debug_printf(3, "wheel delta: %2d", wheel_delta); | 2442 | lcd_putsf(0, 3, "wheel delta: %2d", wheel_delta); |
2454 | debug_printf(4, "accumulated delta: %2d", accumulated_wheel_delta); | 2443 | lcd_putsf(0, 4, "accumulated delta: %2d", accumulated_wheel_delta); |
2455 | debug_printf(5, "velo [deg/s]: %4d", (int)wheel_velocity); | 2444 | lcd_putsf(0, 5, "velo [deg/s]: %4d", (int)wheel_velocity); |
2456 | 2445 | ||
2457 | /* show effective accelerated scrollspeed */ | 2446 | /* show effective accelerated scrollspeed */ |
2458 | speed = button_apply_acceleration( (1<<31)|(1<<24)|wheel_velocity); | 2447 | speed = button_apply_acceleration( (1<<31)|(1<<24)|wheel_velocity); |
2459 | debug_printf(6, "accel. speed: %4d", speed); | 2448 | lcd_putsf(0, 6, "accel. speed: %4d", speed); |
2460 | 2449 | ||
2461 | lcd_update(); | 2450 | lcd_update(); |
2462 | } | 2451 | } |
diff --git a/apps/main.c b/apps/main.c index ca0cded351..3c93b4fea4 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -242,9 +242,6 @@ static void init_tagcache(void) | |||
242 | 242 | ||
243 | while (!tagcache_is_initialized()) | 243 | while (!tagcache_is_initialized()) |
244 | { | 244 | { |
245 | #ifdef HAVE_LCD_CHARCELLS | ||
246 | char buf[32]; | ||
247 | #endif | ||
248 | int ret = tagcache_get_commit_step(); | 245 | int ret = tagcache_get_commit_step(); |
249 | 246 | ||
250 | if (ret > 0) | 247 | if (ret > 0) |
@@ -277,9 +274,8 @@ static void init_tagcache(void) | |||
277 | } | 274 | } |
278 | #else | 275 | #else |
279 | lcd_double_height(false); | 276 | lcd_double_height(false); |
280 | snprintf(buf, sizeof(buf), " DB [%d/%d]", ret, | 277 | lcd_putsf(0, 1, " DB [%d/%d]", ret, |
281 | tagcache_get_max_commit_step()); | 278 | tagcache_get_max_commit_step()); |
282 | lcd_puts(0, 1, buf); | ||
283 | lcd_update(); | 279 | lcd_update(); |
284 | #endif | 280 | #endif |
285 | clear = true; | 281 | clear = true; |
@@ -464,10 +460,8 @@ static void init(void) | |||
464 | if(rc) | 460 | if(rc) |
465 | { | 461 | { |
466 | #ifdef HAVE_LCD_BITMAP | 462 | #ifdef HAVE_LCD_BITMAP |
467 | char str[32]; | ||
468 | lcd_clear_display(); | 463 | lcd_clear_display(); |
469 | snprintf(str, 31, "ATA error: %d", rc); | 464 | lcd_putsf(0, 1, "ATA error: %d", rc); |
470 | lcd_puts(0, 1, str); | ||
471 | lcd_puts(0, 3, "Press ON to debug"); | 465 | lcd_puts(0, 3, "Press ON to debug"); |
472 | lcd_update(); | 466 | lcd_update(); |
473 | while(!(button_get(true) & BUTTON_REL)); /*DO NOT CHANGE TO ACTION SYSTEM */ | 467 | while(!(button_get(true) & BUTTON_REL)); /*DO NOT CHANGE TO ACTION SYSTEM */ |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index da97306cfe..37244a65c6 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -1786,13 +1786,16 @@ bool recording_screen(bool no_source) | |||
1786 | /* draw the clipcounter just in front of the peakmeter */ | 1786 | /* draw the clipcounter just in front of the peakmeter */ |
1787 | if(global_settings.peak_meter_clipcounter) | 1787 | if(global_settings.peak_meter_clipcounter) |
1788 | { | 1788 | { |
1789 | char clpstr[32]; | 1789 | int clipcount = pm_get_clipcount(); |
1790 | snprintf(clpstr, 32, "%4d", pm_get_clipcount()); | ||
1791 | FOR_NB_ACTIVE_SCREENS(i) | 1790 | FOR_NB_ACTIVE_SCREENS(i) |
1792 | { | 1791 | { |
1793 | if(!compact_view[i]) | 1792 | if(!compact_view[i]) |
1794 | screens[i].puts(0, 2,str(LANG_PM_CLIPCOUNT)); | 1793 | { |
1795 | screens[i].puts(0, compact_view[i] ? 2 : 3, clpstr); | 1794 | screens[i].puts(0, 2, str(LANG_PM_CLIPCOUNT)); |
1795 | screens[i].putsf(0, 3, "%4d", clipcount); | ||
1796 | } | ||
1797 | else | ||
1798 | screens[i].putsf(0, 2, "%4d", clipcount); | ||
1796 | } | 1799 | } |
1797 | } | 1800 | } |
1798 | 1801 | ||
diff --git a/apps/screen_access.c b/apps/screen_access.c index 5b2b4724f1..19ab77654e 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c | |||
@@ -182,6 +182,7 @@ struct screen screens[NB_SCREENS] = | |||
182 | 182 | ||
183 | .putsxy=&lcd_putsxy, | 183 | .putsxy=&lcd_putsxy, |
184 | .puts=&lcd_puts, | 184 | .puts=&lcd_puts, |
185 | .putsf=&lcd_putsf, | ||
185 | .puts_offset=&lcd_puts_offset, | 186 | .puts_offset=&lcd_puts_offset, |
186 | .puts_scroll=&lcd_puts_scroll, | 187 | .puts_scroll=&lcd_puts_scroll, |
187 | .puts_scroll_offset=&lcd_puts_scroll_offset, | 188 | .puts_scroll_offset=&lcd_puts_scroll_offset, |
@@ -267,6 +268,7 @@ struct screen screens[NB_SCREENS] = | |||
267 | #endif /* 0 */ | 268 | #endif /* 0 */ |
268 | .putsxy=&lcd_remote_putsxy, | 269 | .putsxy=&lcd_remote_putsxy, |
269 | .puts=&lcd_remote_puts, | 270 | .puts=&lcd_remote_puts, |
271 | .putsf=&lcd_remote_putsf, | ||
270 | .puts_offset=&lcd_remote_puts_offset, | 272 | .puts_offset=&lcd_remote_puts_offset, |
271 | .puts_scroll=&lcd_remote_puts_scroll, | 273 | .puts_scroll=&lcd_remote_puts_scroll, |
272 | .puts_scroll_offset=&lcd_remote_puts_scroll_offset, | 274 | .puts_scroll_offset=&lcd_remote_puts_scroll_offset, |
diff --git a/apps/screen_access.h b/apps/screen_access.h index 07fc36451d..be6247886e 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h | |||
@@ -129,6 +129,7 @@ struct screen | |||
129 | #endif | 129 | #endif |
130 | void (*putsxy)(int x, int y, const unsigned char *str); | 130 | void (*putsxy)(int x, int y, const unsigned char *str); |
131 | void (*puts)(int x, int y, const unsigned char *str); | 131 | void (*puts)(int x, int y, const unsigned char *str); |
132 | void (*putsf)(int x, int y, const unsigned char *str, ...); | ||
132 | void (*puts_offset)(int x, int y, const unsigned char *str, int offset); | 133 | void (*puts_offset)(int x, int y, const unsigned char *str, int offset); |
133 | void (*puts_scroll)(int x, int y, const unsigned char *string); | 134 | void (*puts_scroll)(int x, int y, const unsigned char *string); |
134 | void (*puts_scroll_offset)(int x, int y, const unsigned char *string, | 135 | void (*puts_scroll_offset)(int x, int y, const unsigned char *string, |
diff --git a/apps/screens.c b/apps/screens.c index eb34103a4a..cebe5df023 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -300,11 +300,9 @@ static void charging_display_info(bool animate) | |||
300 | if (ide_powered()) /* FM and V2 can only measure when ATA power is on */ | 300 | if (ide_powered()) /* FM and V2 can only measure when ATA power is on */ |
301 | #endif | 301 | #endif |
302 | { | 302 | { |
303 | char buf[32]; | ||
304 | int battv = battery_voltage(); | 303 | int battv = battery_voltage(); |
305 | snprintf(buf, 32, " Batt: %d.%02dV %d%% ", battv / 1000, | 304 | lcd_putsf(0, 7, " Batt: %d.%02dV %d%% ", battv / 1000, |
306 | (battv % 1000) / 10, battery_level()); | 305 | (battv % 1000) / 10, battery_level()); |
307 | lcd_puts(0, 7, buf); | ||
308 | } | 306 | } |
309 | 307 | ||
310 | #ifdef ARCHOS_RECORDER | 308 | #ifdef ARCHOS_RECORDER |
@@ -400,8 +398,7 @@ static void charging_display_info(bool animate) | |||
400 | char buf[32]; | 398 | char buf[32]; |
401 | 399 | ||
402 | battv = battery_voltage(); | 400 | battv = battery_voltage(); |
403 | snprintf(buf, sizeof(buf), " %d.%02dV", battv / 1000, (battv % 1000) / 10); | 401 | lcd_putsf(4, 1, " %d.%02dV", battv / 1000, (battv % 1000) / 10); |
404 | lcd_puts(4, 1, buf); | ||
405 | 402 | ||
406 | memcpy(buf, logo_pattern, 32); /* copy logo patterns */ | 403 | memcpy(buf, logo_pattern, 32); /* copy logo patterns */ |
407 | 404 | ||
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index d0d3ddec28..30c8a396b5 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c | |||
@@ -27,6 +27,9 @@ | |||
27 | * KIND, either express or implied. | 27 | * KIND, either express or implied. |
28 | * | 28 | * |
29 | ****************************************************************************/ | 29 | ****************************************************************************/ |
30 | #include "stdarg.h" | ||
31 | #include "sprintf.h" | ||
32 | |||
30 | #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ | 33 | #ifndef LCDFN /* Not compiling for remote - define macros for main LCD. */ |
31 | #define LCDFN(fn) lcd_ ## fn | 34 | #define LCDFN(fn) lcd_ ## fn |
32 | #define FBFN(fn) fb_ ## fn | 35 | #define FBFN(fn) fb_ ## fn |
@@ -206,6 +209,17 @@ void LCDFN(puts)(int x, int y, const unsigned char *str) | |||
206 | LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, 0); | 209 | LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, 0); |
207 | } | 210 | } |
208 | 211 | ||
212 | /* Formatting version of LCDFN(puts) */ | ||
213 | void LCDFN(putsf)(int x, int y, const unsigned char *fmt, ...) | ||
214 | { | ||
215 | va_list ap; | ||
216 | char buf[256]; | ||
217 | va_start(ap, fmt); | ||
218 | vsnprintf(buf, sizeof (buf), fmt, ap); | ||
219 | va_end(ap); | ||
220 | LCDFN(puts)(x, y, buf); | ||
221 | } | ||
222 | |||
209 | void LCDFN(puts_style)(int x, int y, const unsigned char *str, int style) | 223 | void LCDFN(puts_style)(int x, int y, const unsigned char *str, int style) |
210 | { | 224 | { |
211 | LCDFN(puts_style_offset)(x, y, str, style, 0); | 225 | LCDFN(puts_style_offset)(x, y, str, style, 0); |
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c index 33337daf19..d02c5eeaad 100644 --- a/firmware/drivers/lcd-charcell.c +++ b/firmware/drivers/lcd-charcell.c | |||
@@ -21,7 +21,8 @@ | |||
21 | ****************************************************************************/ | 21 | ****************************************************************************/ |
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "hwcompat.h" | 23 | #include "hwcompat.h" |
24 | 24 | #include "stdarg.h" | |
25 | #include "sprintf.h" | ||
25 | #include "lcd.h" | 26 | #include "lcd.h" |
26 | #include "kernel.h" | 27 | #include "kernel.h" |
27 | #include "thread.h" | 28 | #include "thread.h" |
@@ -427,6 +428,17 @@ void lcd_puts(int x, int y, const unsigned char *str) | |||
427 | lcd_puts_offset(x, y, str, 0); | 428 | lcd_puts_offset(x, y, str, 0); |
428 | } | 429 | } |
429 | 430 | ||
431 | /* Formatting version of lcd_puts */ | ||
432 | void lcd_putsf(int x, int y, const unsigned char *fmt, ...) | ||
433 | { | ||
434 | va_list ap; | ||
435 | char buf[256]; | ||
436 | va_start(ap, fmt); | ||
437 | vsnprintf(buf, sizeof (buf), fmt, ap); | ||
438 | va_end(ap); | ||
439 | lcd_puts(x, y, buf); | ||
440 | } | ||
441 | |||
430 | /* Put a string at a given char position, skipping first offset chars */ | 442 | /* Put a string at a given char position, skipping first offset chars */ |
431 | void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) | 443 | void lcd_puts_offset(int x, int y, const unsigned char *str, int offset) |
432 | { | 444 | { |
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 01df5a7eab..62e82ca6ac 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h | |||
@@ -121,6 +121,7 @@ extern void lcd_remote_set_viewport(struct viewport* vp); | |||
121 | extern void lcd_remote_clear_display(void); | 121 | extern void lcd_remote_clear_display(void); |
122 | extern void lcd_remote_clear_viewport(void); | 122 | extern void lcd_remote_clear_viewport(void); |
123 | extern void lcd_remote_puts(int x, int y, const unsigned char *str); | 123 | extern void lcd_remote_puts(int x, int y, const unsigned char *str); |
124 | extern void lcd_remote_putsf(int x, int y, const unsigned char *fmt, ...); | ||
124 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, | 125 | extern void lcd_remote_puts_style(int x, int y, const unsigned char *str, |
125 | int style); | 126 | int style); |
126 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, | 127 | extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index bf1680fad2..91217ff76c 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -191,6 +191,7 @@ extern void lcd_clear_viewport(void); | |||
191 | extern void lcd_clear_display(void); | 191 | extern void lcd_clear_display(void); |
192 | extern void lcd_putsxy(int x, int y, const unsigned char *string); | 192 | extern void lcd_putsxy(int x, int y, const unsigned char *string); |
193 | extern void lcd_puts(int x, int y, const unsigned char *string); | 193 | extern void lcd_puts(int x, int y, const unsigned char *string); |
194 | extern void lcd_putsf(int x, int y, const unsigned char *fmt, ...); | ||
194 | extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); | 195 | extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); |
195 | extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset); | 196 | extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset); |
196 | extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, | 197 | extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, |
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 22958c9f22..d8d3e013e2 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c | |||
@@ -31,10 +31,6 @@ | |||
31 | #include "ascodec-target.h" | 31 | #include "ascodec-target.h" |
32 | #include "adc.h" | 32 | #include "adc.h" |
33 | 33 | ||
34 | #define _DEBUG_PRINTF(a,varargs...) do { \ | ||
35 | snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \ | ||
36 | } while(0) | ||
37 | |||
38 | #define ON "Enabled" | 34 | #define ON "Enabled" |
39 | #define OFF "Disabled" | 35 | #define OFF "Disabled" |
40 | 36 | ||
@@ -224,7 +220,6 @@ int calc_freq(int clk) | |||
224 | 220 | ||
225 | bool __dbg_hw_info(void) | 221 | bool __dbg_hw_info(void) |
226 | { | 222 | { |
227 | char buf[50]; | ||
228 | int line; | 223 | int line; |
229 | int last_nand = 0; | 224 | int last_nand = 0; |
230 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2) | 225 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2) |
@@ -240,16 +235,16 @@ bool __dbg_hw_info(void) | |||
240 | { | 235 | { |
241 | lcd_clear_display(); | 236 | lcd_clear_display(); |
242 | line = 0; | 237 | line = 0; |
243 | _DEBUG_PRINTF("[Clock Frequencies:]"); | 238 | lcd_puts(0, line++, "[Clock Frequencies:]"); |
244 | _DEBUG_PRINTF(" SET ACTUAL"); | 239 | lcd_puts(0, line++, " SET ACTUAL"); |
245 | _DEBUG_PRINTF("922T:%s %3dMHz", | 240 | lcd_putsf(0, line++, "922T:%s %3dMHz", |
246 | (!(read_cp15()>>30)) ? "FAST " : | 241 | (!(read_cp15()>>30)) ? "FAST " : |
247 | (read_cp15()>>31) ? "ASYNC" : "SYNC ", | 242 | (read_cp15()>>31) ? "ASYNC" : "SYNC ", |
248 | calc_freq(CLK_922T)/1000000); | 243 | calc_freq(CLK_922T)/1000000); |
249 | _DEBUG_PRINTF("PLLA:%3dMHz %3dMHz", AS3525_PLLA_FREQ/1000000, | 244 | lcd_putsf(0, line++, "PLLA:%3dMHz %3dMHz", AS3525_PLLA_FREQ/1000000, |
250 | calc_freq(CLK_PLLA)/1000000); | 245 | calc_freq(CLK_PLLA)/1000000); |
251 | _DEBUG_PRINTF("PLLB: %3dMHz", calc_freq(CLK_PLLB)/1000000); | 246 | lcd_putsf(0, line++, "PLLB: %3dMHz", calc_freq(CLK_PLLB)/1000000); |
252 | _DEBUG_PRINTF("FCLK: %3dMHz", calc_freq(CLK_FCLK)/1000000); | 247 | lcd_putsf(0, line++, "FCLK: %3dMHz", calc_freq(CLK_FCLK)/1000000); |
253 | 248 | ||
254 | #if LCD_HEIGHT < 176 /* clip */ | 249 | #if LCD_HEIGHT < 176 /* clip */ |
255 | lcd_update(); | 250 | lcd_update(); |
@@ -265,17 +260,17 @@ bool __dbg_hw_info(void) | |||
265 | line = 0; | 260 | line = 0; |
266 | #endif /* LCD_HEIGHT < 176 */ | 261 | #endif /* LCD_HEIGHT < 176 */ |
267 | 262 | ||
268 | _DEBUG_PRINTF("DRAM:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000, | 263 | lcd_putsf(0, line++, "DRAM:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000, |
269 | calc_freq(CLK_EXTMEM)/1000000); | 264 | calc_freq(CLK_EXTMEM)/1000000); |
270 | _DEBUG_PRINTF("PCLK:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000, | 265 | lcd_putsf(0, line++, "PCLK:%3dMHz %3dMHz", AS3525_PCLK_FREQ/1000000, |
271 | calc_freq(CLK_PCLK)/1000000); | 266 | calc_freq(CLK_PCLK)/1000000); |
272 | _DEBUG_PRINTF("IDE :%3dMHz %3dMHz", AS3525_IDE_FREQ/1000000, | 267 | lcd_putsf(0, line++, "IDE :%3dMHz %3dMHz", AS3525_IDE_FREQ/1000000, |
273 | calc_freq(CLK_IDE)/1000000); | 268 | calc_freq(CLK_IDE)/1000000); |
274 | _DEBUG_PRINTF("DBOP:%3dMHz %3dMHz", AS3525_DBOP_FREQ/1000000, | 269 | lcd_putsf(0, line++, "DBOP:%3dMHz %3dMHz", AS3525_DBOP_FREQ/1000000, |
275 | calc_freq(CLK_DBOP)/1000000); | 270 | calc_freq(CLK_DBOP)/1000000); |
276 | _DEBUG_PRINTF("I2C :%3dkHz %3dkHz", AS3525_I2C_FREQ/1000, | 271 | lcd_putsf(0, line++, "I2C :%3dkHz %3dkHz", AS3525_I2C_FREQ/1000, |
277 | calc_freq(CLK_I2C)/1000); | 272 | calc_freq(CLK_I2C)/1000); |
278 | _DEBUG_PRINTF("I2SI: %s %3dMHz", (CGU_AUDIO & (1<<23)) ? | 273 | lcd_putsf(0, line++, "I2SI: %s %3dMHz", (CGU_AUDIO & (1<<23)) ? |
279 | "on " : "off" , calc_freq(CLK_I2SI)/1000000); | 274 | "on " : "off" , calc_freq(CLK_I2SI)/1000000); |
280 | 275 | ||
281 | #if LCD_HEIGHT < 176 /* clip */ | 276 | #if LCD_HEIGHT < 176 /* clip */ |
@@ -292,27 +287,27 @@ bool __dbg_hw_info(void) | |||
292 | line = 0; | 287 | line = 0; |
293 | #endif /* LCD_HEIGHT < 176 */ | 288 | #endif /* LCD_HEIGHT < 176 */ |
294 | 289 | ||
295 | _DEBUG_PRINTF("I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ? | 290 | lcd_putsf(0, line++, "I2SO: %s %3dMHz", (CGU_AUDIO & (1<<11)) ? |
296 | "on " : "off", calc_freq(CLK_I2SO)/1000000); | 291 | "on " : "off", calc_freq(CLK_I2SO)/1000000); |
297 | if(MCI_NAND) | 292 | if(MCI_NAND) |
298 | last_nand = MCI_NAND; | 293 | last_nand = MCI_NAND; |
299 | /* MCLK == PCLK */ | 294 | /* MCLK == PCLK */ |
300 | _DEBUG_PRINTF("SD :%3dMHz %3dMHz", | 295 | lcd_putsf(0, line++, "SD :%3dMHz %3dMHz", |
301 | ((last_nand ? (AS3525_PCLK_FREQ/ 1000000): 0) / | 296 | ((last_nand ? (AS3525_PCLK_FREQ/ 1000000): 0) / |
302 | ((last_nand & MCI_CLOCK_BYPASS)? 1:(((last_nand & 0xff)+1) * 2))), | 297 | ((last_nand & MCI_CLOCK_BYPASS)? 1:(((last_nand & 0xff)+1) * 2))), |
303 | calc_freq(CLK_SD_MCLK_NAND)/1000000); | 298 | calc_freq(CLK_SD_MCLK_NAND)/1000000); |
304 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2) | 299 | #if defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_C200V2) |
305 | if(MCI_SD) | 300 | if(MCI_SD) |
306 | last_sd = MCI_SD; | 301 | last_sd = MCI_SD; |
307 | _DEBUG_PRINTF("uSD :%3dMHz %3dMHz", | 302 | lcd_putsf(0, line++, "uSD :%3dMHz %3dMHz", |
308 | ((last_sd ? (AS3525_PCLK_FREQ/ 1000000): 0) / | 303 | ((last_sd ? (AS3525_PCLK_FREQ/ 1000000): 0) / |
309 | ((last_sd & MCI_CLOCK_BYPASS) ? 1: (((last_sd & 0xff) + 1) * 2))), | 304 | ((last_sd & MCI_CLOCK_BYPASS) ? 1: (((last_sd & 0xff) + 1) * 2))), |
310 | calc_freq(CLK_SD_MCLK_MSD)/1000000); | 305 | calc_freq(CLK_SD_MCLK_MSD)/1000000); |
311 | #endif | 306 | #endif |
312 | _DEBUG_PRINTF("USB : %3dMHz", calc_freq(CLK_USB)/1000000); | 307 | lcd_putsf(0, line++, "USB : %3dMHz", calc_freq(CLK_USB)/1000000); |
313 | _DEBUG_PRINTF("MMU : %s CVDDP:%4d", (read_cp15() & CP15_MMU) ? | 308 | lcd_putsf(0, line++, "MMU : %s CVDDP:%4d", (read_cp15() & CP15_MMU) ? |
314 | " on" : "off", adc_read(ADC_CVDD) * 25); | 309 | " on" : "off", adc_read(ADC_CVDD) * 25); |
315 | _DEBUG_PRINTF("Icache:%s Dcache:%s", | 310 | lcd_putsf(0, line++, "Icache:%s Dcache:%s", |
316 | (read_cp15() & CP15_IC) ? " on" : "off", | 311 | (read_cp15() & CP15_IC) ? " on" : "off", |
317 | (read_cp15() & CP15_DC) ? " on" : "off"); | 312 | (read_cp15() & CP15_DC) ? " on" : "off"); |
318 | 313 | ||
@@ -328,12 +323,12 @@ bool __dbg_hw_info(void) | |||
328 | lcd_clear_display(); | 323 | lcd_clear_display(); |
329 | line = 0; | 324 | line = 0; |
330 | 325 | ||
331 | _DEBUG_PRINTF("CGU_PLLA :%8x", (unsigned int)(CGU_PLLA)); | 326 | lcd_putsf(0, line++, "CGU_PLLA :%8x", (unsigned int)(CGU_PLLA)); |
332 | _DEBUG_PRINTF("CGU_PLLB :%8x", (unsigned int)(CGU_PLLB)); | 327 | lcd_putsf(0, line++, "CGU_PLLB :%8x", (unsigned int)(CGU_PLLB)); |
333 | _DEBUG_PRINTF("CGU_PROC :%8x", (unsigned int)(CGU_PROC)); | 328 | lcd_putsf(0, line++, "CGU_PROC :%8x", (unsigned int)(CGU_PROC)); |
334 | _DEBUG_PRINTF("CGU_PERI :%8x", (unsigned int)(CGU_PERI)); | 329 | lcd_putsf(0, line++, "CGU_PERI :%8x", (unsigned int)(CGU_PERI)); |
335 | _DEBUG_PRINTF("CGU_IDE :%8x", (unsigned int)(CGU_IDE)); | 330 | lcd_putsf(0, line++, "CGU_IDE :%8x", (unsigned int)(CGU_IDE)); |
336 | _DEBUG_PRINTF("CGU_DBOP :%8x", (unsigned int)(CGU_DBOP)); | 331 | lcd_putsf(0, line++, "CGU_DBOP :%8x", (unsigned int)(CGU_DBOP)); |
337 | 332 | ||
338 | #if LCD_HEIGHT < 176 /* clip */ | 333 | #if LCD_HEIGHT < 176 /* clip */ |
339 | lcd_update(); | 334 | lcd_update(); |
@@ -349,12 +344,12 @@ bool __dbg_hw_info(void) | |||
349 | line = 0; | 344 | line = 0; |
350 | #endif /* LCD_HEIGHT < 176 */ | 345 | #endif /* LCD_HEIGHT < 176 */ |
351 | 346 | ||
352 | _DEBUG_PRINTF("CGU_AUDIO :%8x", (unsigned int)(CGU_AUDIO)); | 347 | lcd_putsf(0, line++, "CGU_AUDIO :%8x", (unsigned int)(CGU_AUDIO)); |
353 | _DEBUG_PRINTF("CGU_USB :%8x", (unsigned int)(CGU_USB)); | 348 | lcd_putsf(0, line++, "CGU_USB :%8x", (unsigned int)(CGU_USB)); |
354 | _DEBUG_PRINTF("I2C2_CPSR :%8x", (unsigned int)(I2C2_CPSR1<<8 | | 349 | lcd_putsf(0, line++, "I2C2_CPSR :%8x", (unsigned int)(I2C2_CPSR1<<8 | |
355 | I2C2_CPSR0)); | 350 | I2C2_CPSR0)); |
356 | _DEBUG_PRINTF("MCI_NAND :%8x", (unsigned int)(MCI_NAND)); | 351 | lcd_putsf(0, line++, "MCI_NAND :%8x", (unsigned int)(MCI_NAND)); |
357 | _DEBUG_PRINTF("MCI_SD :%8x", (unsigned int)(MCI_SD)); | 352 | lcd_putsf(0, line++, "MCI_SD :%8x", (unsigned int)(MCI_SD)); |
358 | 353 | ||
359 | lcd_update(); | 354 | lcd_update(); |
360 | int btn = button_get_w_tmo(HZ/10); | 355 | int btn = button_get_w_tmo(HZ/10); |
@@ -372,7 +367,6 @@ end: | |||
372 | 367 | ||
373 | bool __dbg_ports(void) | 368 | bool __dbg_ports(void) |
374 | { | 369 | { |
375 | char buf[50]; | ||
376 | int line; | 370 | int line; |
377 | 371 | ||
378 | lcd_clear_display(); | 372 | lcd_clear_display(); |
@@ -381,19 +375,19 @@ bool __dbg_ports(void) | |||
381 | while(1) | 375 | while(1) |
382 | { | 376 | { |
383 | line = 0; | 377 | line = 0; |
384 | _DEBUG_PRINTF("[GPIO Values and Directions]"); | 378 | lcd_puts(0, line++, "[GPIO Values and Directions]"); |
385 | _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR); | 379 | lcd_putsf(0, line++, "GPIOA: %2x DIR: %2x", GPIOA_DATA, GPIOA_DIR); |
386 | _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR); | 380 | lcd_putsf(0, line++, "GPIOB: %2x DIR: %2x", GPIOB_DATA, GPIOB_DIR); |
387 | _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR); | 381 | lcd_putsf(0, line++, "GPIOC: %2x DIR: %2x", GPIOC_DATA, GPIOC_DIR); |
388 | _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR); | 382 | lcd_putsf(0, line++, "GPIOD: %2x DIR: %2x", GPIOD_DATA, GPIOD_DIR); |
389 | #ifdef DEBUG_DBOP | 383 | #ifdef DEBUG_DBOP |
390 | line++; | 384 | line++; |
391 | _DEBUG_PRINTF("[DBOP_DIN]"); | 385 | lcd_puts(0, line++, "[DBOP_DIN]"); |
392 | _DEBUG_PRINTF("DBOP_DIN: %4x", button_dbop_data()); | 386 | lcd_putsf(0, line++, "DBOP_DIN: %4x", button_dbop_data()); |
393 | #endif | 387 | #endif |
394 | line++; | 388 | line++; |
395 | _DEBUG_PRINTF("[CP15]"); | 389 | lcd_puts(0, line++, "[CP15]"); |
396 | _DEBUG_PRINTF("CP15: 0x%8x", read_cp15()); | 390 | lcd_putsf(0, line++, "CP15: 0x%8x", read_cp15()); |
397 | lcd_update(); | 391 | lcd_update(); |
398 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 392 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
399 | break; | 393 | break; |
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c index cc1e200c11..dc3c293495 100644 --- a/firmware/target/arm/imx31/debug-imx31.c +++ b/firmware/target/arm/imx31/debug-imx31.c | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | bool __dbg_hw_info(void) | 33 | bool __dbg_hw_info(void) |
34 | { | 34 | { |
35 | char buf[50]; | ||
36 | int line; | 35 | int line; |
37 | unsigned int pllref; | 36 | unsigned int pllref; |
38 | unsigned int mcu_pllfreq, ser_pllfreq, usb_pllfreq; | 37 | unsigned int mcu_pllfreq, ser_pllfreq, usb_pllfreq; |
@@ -46,9 +45,8 @@ bool __dbg_hw_info(void) | |||
46 | while (1) | 45 | while (1) |
47 | { | 46 | { |
48 | line = 0; | 47 | line = 0; |
49 | snprintf(buf, sizeof (buf), "Sys Rev Code: 0x%02X", | 48 | lcd_putsf(0, line++, "Sys Rev Code: 0x%02X", iim_system_rev()); |
50 | iim_system_rev()); | 49 | line++; |
51 | lcd_puts(0, line++, buf); line++; | ||
52 | 50 | ||
53 | mpctl = CCM_MPCTL; | 51 | mpctl = CCM_MPCTL; |
54 | spctl = CCM_SPCTL; | 52 | spctl = CCM_SPCTL; |
@@ -60,69 +58,55 @@ bool __dbg_hw_info(void) | |||
60 | ser_pllfreq = ccm_get_pll(PLL_SERIAL); | 58 | ser_pllfreq = ccm_get_pll(PLL_SERIAL); |
61 | usb_pllfreq = ccm_get_pll(PLL_USB); | 59 | usb_pllfreq = ccm_get_pll(PLL_USB); |
62 | 60 | ||
63 | snprintf(buf, sizeof (buf), "pll_ref_clk: %u", pllref); | 61 | lcd_putsf(0, line++, "pll_ref_clk: %u", pllref); |
64 | lcd_puts(0, line++, buf); line++; | 62 | line++; |
65 | 63 | ||
66 | /* MCU clock domain */ | 64 | /* MCU clock domain */ |
67 | snprintf(buf, sizeof (buf), "MPCTL: %08lX", mpctl); | 65 | lcd_putsf(0, line++, "MPCTL: %08lX", mpctl); |
68 | lcd_puts(0, line++, buf); | ||
69 | 66 | ||
70 | snprintf(buf, sizeof (buf), " mpl_dpdgck_clk: %u", mcu_pllfreq); | 67 | lcd_putsf(0, line++, " mpl_dpdgck_clk: %u", mcu_pllfreq); |
71 | lcd_puts(0, line++, buf); line++; | 68 | line++; |
72 | 69 | ||
73 | regval = CCM_PDR0; | 70 | regval = CCM_PDR0; |
74 | snprintf(buf, sizeof (buf), " PDR0: %08lX", regval); | 71 | lcd_putsf(0, line++, " PDR0: %08lX", regval); |
75 | lcd_puts(0, line++, buf); | ||
76 | 72 | ||
77 | freq = mcu_pllfreq / (((regval & 0x7) + 1)); | 73 | freq = mcu_pllfreq / (((regval & 0x7) + 1)); |
78 | snprintf(buf, sizeof (buf), " mcu_clk: %u", freq); | 74 | lcd_putsf(0, line++, " mcu_clk: %u", freq); |
79 | lcd_puts(0, line++, buf); | ||
80 | 75 | ||
81 | freq = mcu_pllfreq / (((regval >> 11) & 0x7) + 1); | 76 | freq = mcu_pllfreq / (((regval >> 11) & 0x7) + 1); |
82 | snprintf(buf, sizeof (buf), " hsp_clk: %u", freq); | 77 | lcd_putsf(0, line++, " hsp_clk: %u", freq); |
83 | lcd_puts(0, line++, buf); | ||
84 | 78 | ||
85 | freq = mcu_pllfreq / (((regval >> 3) & 0x7) + 1); | 79 | freq = mcu_pllfreq / (((regval >> 3) & 0x7) + 1); |
86 | snprintf(buf, sizeof (buf), " hclk_clk: %u", freq); | 80 | lcd_putsf(0, line++, " hclk_clk: %u", freq); |
87 | lcd_puts(0, line++, buf); | ||
88 | 81 | ||
89 | snprintf(buf, sizeof (buf), " ipg_clk: %u", | 82 | lcd_putsf(0, line++, " ipg_clk: %u", |
90 | freq / (unsigned)(((regval >> 6) & 0x3) + 1)); | 83 | freq / (unsigned)(((regval >> 6) & 0x3) + 1)); |
91 | lcd_puts(0, line++, buf); | ||
92 | 84 | ||
93 | snprintf(buf, sizeof (buf), " nfc_clk: %u", | 85 | lcd_putsf(0, line++, " nfc_clk: %u", |
94 | freq / (unsigned)(((regval >> 8) & 0x7) + 1)); | 86 | freq / (unsigned)(((regval >> 8) & 0x7) + 1)); |
95 | lcd_puts(0, line++, buf); | ||
96 | 87 | ||
97 | line++; | 88 | line++; |
98 | 89 | ||
99 | /* Serial clock domain */ | 90 | /* Serial clock domain */ |
100 | snprintf(buf, sizeof (buf), "SPCTL: %08lX", spctl); | 91 | lcd_putsf(0, line++, "SPCTL: %08lX", spctl); |
101 | lcd_puts(0, line++, buf); | 92 | lcd_putsf(0, line++, " spl_dpdgck_clk: %u", ser_pllfreq); |
102 | snprintf(buf, sizeof (buf), " spl_dpdgck_clk: %u", ser_pllfreq); | ||
103 | lcd_puts(0, line++, buf); | ||
104 | 93 | ||
105 | line++; | 94 | line++; |
106 | 95 | ||
107 | /* USB clock domain */ | 96 | /* USB clock domain */ |
108 | snprintf(buf, sizeof (buf), "UPCTL: %08lX", upctl); | 97 | lcd_putsf(0, line++, "UPCTL: %08lX", upctl); |
109 | lcd_puts(0, line++, buf); | ||
110 | 98 | ||
111 | snprintf(buf, sizeof (buf), " upl_dpdgck_clk: %u", usb_pllfreq); | 99 | lcd_putsf(0, line++, " upl_dpdgck_clk: %u", usb_pllfreq); |
112 | lcd_puts(0, line++, buf); line++; | ||
113 | 100 | ||
114 | regval = CCM_PDR1; | 101 | regval = CCM_PDR1; |
115 | snprintf(buf, sizeof (buf), " PDR1: %08lX", regval); | 102 | lcd_putsf(0, line++, " PDR1: %08lX", regval); |
116 | lcd_puts(0, line++, buf); | ||
117 | 103 | ||
118 | freq = usb_pllfreq / | 104 | freq = usb_pllfreq / |
119 | ((((regval >> 30) & 0x3) + 1) * (((regval >> 27) & 0x7) + 1)); | 105 | ((((regval >> 30) & 0x3) + 1) * (((regval >> 27) & 0x7) + 1)); |
120 | snprintf(buf, sizeof (buf), " usb_clk: %u", freq); | 106 | lcd_putsf(0, line++, " usb_clk: %u", freq); |
121 | lcd_puts(0, line++, buf); | ||
122 | 107 | ||
123 | freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1); | 108 | freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1); |
124 | snprintf(buf, sizeof (buf), " ipg_per_baud: %u", freq); | 109 | lcd_putsf(0, line++, " ipg_per_baud: %u", freq); |
125 | lcd_puts(0, line++, buf); | ||
126 | 110 | ||
127 | lcd_update(); | 111 | lcd_update(); |
128 | 112 | ||
@@ -133,7 +117,6 @@ bool __dbg_hw_info(void) | |||
133 | 117 | ||
134 | bool __dbg_ports(void) | 118 | bool __dbg_ports(void) |
135 | { | 119 | { |
136 | char buf[50]; | ||
137 | int line; | 120 | int line; |
138 | int i; | 121 | int i; |
139 | 122 | ||
@@ -171,71 +154,62 @@ bool __dbg_ports(void) | |||
171 | while(1) | 154 | while(1) |
172 | { | 155 | { |
173 | line = 0; | 156 | line = 0; |
174 | snprintf(buf, sizeof(buf), "[Ports and Registers]"); | 157 | lcd_puts(0, line++, "[Ports and Registers]"); |
175 | lcd_puts(0, line++, buf); line++; | 158 | line++; |
176 | 159 | ||
177 | /* GPIO1 */ | 160 | /* GPIO1 */ |
178 | snprintf(buf, sizeof(buf), "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR); | 161 | lcd_putsf(0, line++, "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR); |
179 | lcd_puts(0, line++, buf); | ||
180 | 162 | ||
181 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1); | 163 | lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1); |
182 | lcd_puts(0, line++, buf); | ||
183 | 164 | ||
184 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR); | 165 | lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR); |
185 | lcd_puts(0, line++, buf); | ||
186 | 166 | ||
187 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO1_ISR); | 167 | lcd_putsf(0, line++, " ISR: %08lx", GPIO1_ISR); |
188 | lcd_puts(0, line++, buf); line++; | 168 | line++; |
189 | 169 | ||
190 | /* GPIO2 */ | 170 | /* GPIO2 */ |
191 | snprintf(buf, sizeof(buf), "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR); | 171 | lcd_putsf(0, line++, "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR); |
192 | lcd_puts(0, line++, buf); | ||
193 | 172 | ||
194 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1); | 173 | lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1); |
195 | lcd_puts(0, line++, buf); | ||
196 | 174 | ||
197 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR); | 175 | lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR); |
198 | lcd_puts(0, line++, buf); | ||
199 | 176 | ||
200 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO2_ISR); | 177 | lcd_putsf(0, line++, " ISR: %08lx", GPIO2_ISR); |
201 | lcd_puts(0, line++, buf); line++; | 178 | line++; |
202 | 179 | ||
203 | /* GPIO3 */ | 180 | /* GPIO3 */ |
204 | snprintf(buf, sizeof(buf), "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR); | 181 | lcd_putsf(0, line++, "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR); |
205 | lcd_puts(0, line++, buf); | ||
206 | 182 | ||
207 | snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1); | 183 | lcd_putsf(0, line++, " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1); |
208 | lcd_puts(0, line++, buf); | ||
209 | 184 | ||
210 | snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR); | 185 | lcd_putsf(0, line++, " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR); |
211 | lcd_puts(0, line++, buf); | ||
212 | 186 | ||
213 | snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR); | 187 | lcd_putsf(0, line++, " ISR: %08lx", GPIO3_ISR); |
214 | lcd_puts(0, line++, buf); line++; | 188 | line++; |
215 | 189 | ||
216 | lcd_puts(0, line++, "PMIC Registers"); line++; | 190 | lcd_puts(0, line++, "PMIC Registers"); |
191 | line++; | ||
217 | 192 | ||
218 | mc13783_read_regset(pmic_regset, pmic_regs, ARRAYLEN(pmic_regs)); | 193 | mc13783_read_regset(pmic_regset, pmic_regs, ARRAYLEN(pmic_regs)); |
219 | 194 | ||
220 | for (i = 0; i < (int)ARRAYLEN(pmic_regs); i++) | 195 | for (i = 0; i < (int)ARRAYLEN(pmic_regs); i++) |
221 | { | 196 | { |
222 | snprintf(buf, sizeof(buf), "%s: %08lx", pmic_regnames[i], pmic_regs[i]); | 197 | lcd_putsf(0, line++, "%s: %08lx", pmic_regnames[i], pmic_regs[i]); |
223 | lcd_puts(0, line++, buf); | ||
224 | } | 198 | } |
225 | 199 | ||
226 | line++; | 200 | line++; |
227 | 201 | ||
228 | lcd_puts(0, line++, "ADC"); line++; | 202 | lcd_puts(0, line++, "ADC"); |
203 | line++; | ||
229 | 204 | ||
230 | for (i = 0; i < NUM_ADC_CHANNELS; i += 4) | 205 | for (i = 0; i < NUM_ADC_CHANNELS; i += 4) |
231 | { | 206 | { |
232 | snprintf(buf, sizeof(buf), | 207 | lcd_putsf(0, line++, |
233 | "CH%02d:%04u CH%02d:%04u CH%02d:%04u CH%02d:%04u", | 208 | "CH%02d:%04u CH%02d:%04u CH%02d:%04u CH%02d:%04u", |
234 | i+0, adc_read(i+0), | 209 | i+0, adc_read(i+0), |
235 | i+1, adc_read(i+1), | 210 | i+1, adc_read(i+1), |
236 | i+2, adc_read(i+2), | 211 | i+2, adc_read(i+2), |
237 | i+3, adc_read(i+3)); | 212 | i+3, adc_read(i+3)); |
238 | lcd_puts(0, line++, buf); | ||
239 | } | 213 | } |
240 | 214 | ||
241 | lcd_update(); | 215 | lcd_update(); |
diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c index 6c01f8bc1a..df3fa3c026 100644 --- a/firmware/target/arm/s3c2440/debug-s3c2440.c +++ b/firmware/target/arm/s3c2440/debug-s3c2440.c | |||
@@ -46,40 +46,39 @@ bool __dbg_ports(void) | |||
46 | while(1) | 46 | while(1) |
47 | { | 47 | { |
48 | line = 0; | 48 | line = 0; |
49 | snprintf(buf, sizeof(buf), "[Ports and Registers]"); | 49 | lcd_puts(0, line++, "[Ports and Registers]"); |
50 | lcd_puts(0, line++, buf); | ||
51 | 50 | ||
52 | snprintf(buf, sizeof(buf), "GPACON: %08lx GPBCON: %08lx", GPACON, GPBCON); lcd_puts(0, line++, buf); | 51 | lcd_putsf(0, line++, "GPACON: %08lx GPBCON: %08lx", GPACON, GPBCON); |
53 | snprintf(buf, sizeof(buf), "GPADAT: %08lx GPBDAT: %08lx", GPADAT, GPBDAT); lcd_puts(0, line++, buf); | 52 | lcd_putsf(0, line++, "GPADAT: %08lx GPBDAT: %08lx", GPADAT, GPBDAT); |
54 | snprintf(buf, sizeof(buf), "GPAUP: %08lx GPBUP: %08lx", 0ul, GPBUP); lcd_puts(0, line++, buf); | 53 | lcd_putsf(0, line++, "GPAUP: %08lx GPBUP: %08lx", 0ul, GPBUP); |
55 | snprintf(buf, sizeof(buf), "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); lcd_puts(0, line++, buf); | 54 | lcd_putsf(0, line++, "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); |
56 | snprintf(buf, sizeof(buf), "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | 55 | lcd_putsf(0, line++, "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); |
57 | snprintf(buf, sizeof(buf), "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP); lcd_puts(0, line++, buf); | 56 | lcd_putsf(0, line++, "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP) |
58 | 57 | ||
59 | snprintf(buf, sizeof(buf), "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); lcd_puts(0, line++, buf); | 58 | lcd_putsf(0, line++, "GPCCON: %08lx GPDCON: %08lx", GPCCON, GPDCON); |
60 | snprintf(buf, sizeof(buf), "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); lcd_puts(0, line++, buf); | 59 | lcd_putsf(0, line++, "GPCDAT: %08lx GPDDAT: %08lx", GPCDAT, GPDDAT); |
61 | snprintf(buf, sizeof(buf), "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP); lcd_puts(0, line++, buf); | 60 | lcd_putsf(0, line++, "GPCUP: %08lx GPDUP: %08lx", GPCUP, GPDUP); |
62 | 61 | ||
63 | snprintf(buf, sizeof(buf), "GPECON: %08lx GPFCON: %08lx", GPECON, GPFCON); lcd_puts(0, line++, buf); | 62 | lcd_putsf(0, line++, "GPECON: %08lx GPFCON: %08lx", GPECON, GPFCON); |
64 | snprintf(buf, sizeof(buf), "GPEDAT: %08lx GPFDAT: %08lx", GPEDAT, GPFDAT); lcd_puts(0, line++, buf); | 63 | lcd_putsf(0, line++, "GPEDAT: %08lx GPFDAT: %08lx", GPEDAT, GPFDAT); |
65 | snprintf(buf, sizeof(buf), "GPEUP: %08lx GPFUP: %08lx", GPEUP, GPFUP); lcd_puts(0, line++, buf); | 64 | lcd_putsf(0, line++, "GPEUP: %08lx GPFUP: %08lx", GPEUP, GPFUP); |
66 | 65 | ||
67 | snprintf(buf, sizeof(buf), "GPGCON: %08lx GPHCON: %08lx", GPGCON, GPHCON); lcd_puts(0, line++, buf); | 66 | lcd_putsf(0, line++, "GPGCON: %08lx GPHCON: %08lx", GPGCON, GPHCON); |
68 | snprintf(buf, sizeof(buf), "GPGDAT: %08lx GPHDAT: %08lx", GPGDAT, GPHDAT); lcd_puts(0, line++, buf); | 67 | lcd_putsf(0, line++, "GPGDAT: %08lx GPHDAT: %08lx", GPGDAT, GPHDAT); |
69 | snprintf(buf, sizeof(buf), "GPGUP: %08lx GPHUP: %08lx", GPGUP, GPHUP); lcd_puts(0, line++, buf); | 68 | lcd_putsf(0, line++, "GPGUP: %08lx GPHUP: %08lx", GPGUP, GPHUP); |
70 | 69 | ||
71 | snprintf(buf, sizeof(buf), "GPJCON: %08lx", GPJCON); lcd_puts(0, line++, buf); | 70 | lcd_putsf(0, line++, "GPJCON: %08lx", GPJCON); |
72 | snprintf(buf, sizeof(buf), "GPJDAT: %08lx", GPJDAT); lcd_puts(0, line++, buf); | 71 | lcd_putsf(0, line++, "GPJDAT: %08lx", GPJDAT); |
73 | snprintf(buf, sizeof(buf), "GPJUP: %08lx", GPJUP); lcd_puts(0, line++, buf); | 72 | lcd_putsf(0, line++, "GPJUP: %08lx", GPJUP); |
74 | 73 | ||
75 | line++; | 74 | line++; |
76 | 75 | ||
77 | snprintf(buf, sizeof(buf), "SRCPND: %08lx INTMOD: %08lx", SRCPND, INTMOD); lcd_puts(0, line++, buf); | 76 | lcd_putsf(0, line++, "SRCPND: %08lx INTMOD: %08lx", SRCPND, INTMOD); |
78 | snprintf(buf, sizeof(buf), "INTMSK: %08lx INTPND: %08lx", INTMSK, INTPND); lcd_puts(0, line++, buf); | 77 | lcd_putsf(0, line++, "INTMSK: %08lx INTPND: %08lx", INTMSK, INTPND); |
79 | snprintf(buf, sizeof(buf), "CLKCON: %08lx CLKSLOW: %08lx", CLKCON, CLKSLOW); lcd_puts(0, line++, buf); | 78 | lcd_putsf(0, line++, "CLKCON: %08lx CLKSLOW: %08lx", CLKCON, CLKSLOW); |
80 | snprintf(buf, sizeof(buf), "MPLLCON: %08lx UPLLCON: %08lx", MPLLCON, UPLLCON); lcd_puts(0, line++, buf); | 79 | lcd_putsf(0, line++, "MPLLCON: %08lx UPLLCON: %08lx", MPLLCON, UPLLCON); |
81 | snprintf(buf, sizeof(buf), "CLKDIVN: %08lx CAMDIVN: %08lx", CLKDIVN, CAMDIVN); lcd_puts(0, line++, buf); | 80 | lcd_putsf(0, line++, "CLKDIVN: %08lx CAMDIVN: %08lx", CLKDIVN, CAMDIVN); |
82 | snprintf(buf, sizeof(buf), "BWSCON: %08lx TCONSEL: %08lx", BWSCON, TCONSEL); lcd_puts(0, line++, buf); | 81 | lcd_putsf(0, line++, "BWSCON: %08lx TCONSEL: %08lx", BWSCON, TCONSEL); |
83 | 82 | ||
84 | lcd_update(); | 83 | lcd_update(); |
85 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 84 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
diff --git a/firmware/target/arm/system-arm.c b/firmware/target/arm/system-arm.c index 5c5a18c867..920dbacd10 100644 --- a/firmware/target/arm/system-arm.c +++ b/firmware/target/arm/system-arm.c | |||
@@ -36,16 +36,13 @@ static const char* const uiename[] = { | |||
36 | */ | 36 | */ |
37 | void __attribute__((noreturn)) UIE(unsigned int pc, unsigned int num) | 37 | void __attribute__((noreturn)) UIE(unsigned int pc, unsigned int num) |
38 | { | 38 | { |
39 | char str[32]; | ||
40 | |||
41 | lcd_clear_display(); | 39 | lcd_clear_display(); |
42 | #ifdef HAVE_LCD_BITMAP | 40 | #ifdef HAVE_LCD_BITMAP |
43 | lcd_setfont(FONT_SYSFIXED); | 41 | lcd_setfont(FONT_SYSFIXED); |
44 | #endif | 42 | #endif |
45 | lcd_puts(0, 0, uiename[num]); | 43 | lcd_puts(0, 0, uiename[num]); |
46 | snprintf(str, sizeof(str), "at %08x" IF_COP(" (%d)"), pc | 44 | lcd_putsf(0, 1, "at %08x" IF_COP(" (%d)"), pc |
47 | IF_COP(, CURRENT_CORE)); | 45 | IF_COP(, CURRENT_CORE)); |
48 | lcd_puts(0, 1, str); | ||
49 | lcd_update(); | 46 | lcd_update(); |
50 | 47 | ||
51 | disable_interrupt(IRQ_FIQ_STATUS); | 48 | disable_interrupt(IRQ_FIQ_STATUS); |
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c index 53acd3f655..d4d478a007 100755 --- a/firmware/target/arm/tms320dm320/debug-dm320.c +++ b/firmware/target/arm/tms320dm320/debug-dm320.c | |||
@@ -48,7 +48,6 @@ bool __dbg_hw_info(void) | |||
48 | int *address=0x0; | 48 | int *address=0x0; |
49 | #endif | 49 | #endif |
50 | bool done=false; | 50 | bool done=false; |
51 | char buf[100]; | ||
52 | 51 | ||
53 | lcd_setfont(FONT_SYSFIXED); | 52 | lcd_setfont(FONT_SYSFIXED); |
54 | lcd_clear_display(); | 53 | lcd_clear_display(); |
@@ -58,38 +57,27 @@ bool __dbg_hw_info(void) | |||
58 | 57 | ||
59 | lcd_puts(0, line++, "Clock info:"); | 58 | lcd_puts(0, line++, "Clock info:"); |
60 | #if LCD_WIDTH > 320 | 59 | #if LCD_WIDTH > 320 |
61 | snprintf(buf, sizeof(buf), "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", | 60 | lcd_putsf(0, line++, "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", |
62 | IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); lcd_puts(0, line++, buf); | 61 | IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); |
63 | snprintf(buf, sizeof(buf), "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", | 62 | lcd_putsf(0, line++, "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", |
64 | IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2); lcd_puts(0, line++, buf); | 63 | IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2); |
65 | snprintf(buf, sizeof(buf), "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", | 64 | lcd_putsf(0, line++, "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", |
66 | IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); lcd_puts(0, line++, buf); | 65 | IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); |
67 | snprintf(buf, sizeof(buf), "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x", | 66 | lcd_putsf(0, line++, "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x", |
68 | IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); lcd_puts(0, line++, buf); | 67 | IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); |
69 | #else | 68 | #else |
70 | snprintf(buf, sizeof(buf), " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB); | 69 | lcd_putsf(0, line++, " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB); |
71 | lcd_puts(0, line++, buf); | 70 | lcd_putsf(0, line++, " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1); |
72 | snprintf(buf, sizeof(buf), " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1); | 71 | lcd_putsf(0, line++, " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0); |
73 | lcd_puts(0, line++, buf); | 72 | lcd_putsf(0, line++, " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2); |
74 | snprintf(buf, sizeof(buf), " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0); | 73 | lcd_putsf(0, line++, " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4); |
75 | lcd_puts(0, line++, buf); | 74 | lcd_putsf(0, line++, " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV); |
76 | snprintf(buf, sizeof(buf), " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2); | 75 | lcd_putsf(0, line++, " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1); |
77 | lcd_puts(0, line++, buf); | 76 | lcd_putsf(0, line++, " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0); |
78 | snprintf(buf, sizeof(buf), " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4); | ||
79 | lcd_puts(0, line++, buf); | ||
80 | snprintf(buf, sizeof(buf), " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV); | ||
81 | lcd_puts(0, line++, buf); | ||
82 | snprintf(buf, sizeof(buf), " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1); | ||
83 | lcd_puts(0, line++, buf); | ||
84 | snprintf(buf, sizeof(buf), " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0); | ||
85 | lcd_puts(0, line++, buf); | ||
86 | lcd_puts(0, line++, "Interrupt info:"); | 77 | lcd_puts(0, line++, "Interrupt info:"); |
87 | snprintf(buf, sizeof(buf), " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1); | 78 | lcd_putsf(0, line++, " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1); |
88 | lcd_puts(0, line++, buf); | 79 | lcd_putsf(0, line++, " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0); |
89 | snprintf(buf, sizeof(buf), " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0); | 80 | lcd_putsf(0, line++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2); |
90 | lcd_puts(0, line++, buf); | ||
91 | snprintf(buf, sizeof(buf), " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2); | ||
92 | lcd_puts(0, line++, buf); | ||
93 | #endif | 81 | #endif |
94 | 82 | ||
95 | lcd_puts(0, line++, "Board revision:"); | 83 | lcd_puts(0, line++, "Board revision:"); |
@@ -134,20 +122,19 @@ bool __dbg_hw_info(void) | |||
134 | lcd_set_direct_fb(true); | 122 | lcd_set_direct_fb(true); |
135 | 123 | ||
136 | lcd_puts(0, line++, "LCD info:"); | 124 | lcd_puts(0, line++, "LCD info:"); |
137 | snprintf(buf, sizeof(buf), " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no")); | 125 | lcd_putsf(0, line++, " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no")); |
138 | lcd_puts(0, line++, buf); | ||
139 | line++; | 126 | line++; |
140 | #endif | 127 | #endif |
141 | lcd_puts(0, line++, "[Rockbox info]"); | 128 | lcd_puts(0, line++, "[Rockbox info]"); |
142 | snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d", | 129 | lcd_putsf(0, line++, "current tick: %08x Seconds running: %08d", |
143 | (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf); | 130 | (unsigned int)current_tick, (unsigned int)current_tick/100); |
144 | #ifndef CREATIVE_ZVx | 131 | #ifndef CREATIVE_ZVx |
145 | snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", | 132 | lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x", |
146 | (unsigned int)address, *address); lcd_puts(0, line++, buf); | 133 | (unsigned int)address, *address); |
147 | snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", | 134 | lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x", |
148 | (unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf); | 135 | (unsigned int)(address+1), *(address+1)); |
149 | snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", | 136 | lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x", |
150 | (unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf); | 137 | (unsigned int)(address+2), *(address+2)); |
151 | #endif | 138 | #endif |
152 | 139 | ||
153 | lcd_update(); | 140 | lcd_update(); |
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c index a96cd34441..8ae702fdfc 100644 --- a/firmware/target/coldfire/system-coldfire.c +++ b/firmware/target/coldfire/system-coldfire.c | |||
@@ -165,16 +165,13 @@ static void system_display_exception_info(unsigned long format, | |||
165 | unsigned long pc) | 165 | unsigned long pc) |
166 | { | 166 | { |
167 | int vector = (format >> 18) & 0xff; | 167 | int vector = (format >> 18) & 0xff; |
168 | char str[32]; | ||
169 | 168 | ||
170 | /* clear screen */ | 169 | /* clear screen */ |
171 | lcd_clear_display (); | 170 | lcd_clear_display (); |
172 | lcd_setfont(FONT_SYSFIXED); | 171 | lcd_setfont(FONT_SYSFIXED); |
173 | 172 | ||
174 | snprintf(str, sizeof(str), "I%02x:%s", vector, irqname[vector]); | 173 | lcd_putsf(0, 0, "I%02x:%s", vector, irqname[vector]); |
175 | lcd_puts(0, 0, str); | 174 | lcd_putsf(0, 1, "at %08x", pc); |
176 | snprintf(str, sizeof(str), "at %08x", pc); | ||
177 | lcd_puts(0, 1, str); | ||
178 | lcd_update(); | 175 | lcd_update(); |
179 | 176 | ||
180 | system_exception_wait(); | 177 | system_exception_wait(); |
diff --git a/firmware/target/sh/system-sh.c b/firmware/target/sh/system-sh.c index 7779c975a7..24821095e8 100644 --- a/firmware/target/sh/system-sh.c +++ b/firmware/target/sh/system-sh.c | |||
@@ -295,22 +295,19 @@ void UIE (unsigned int pc) __attribute__((section(".text"))); | |||
295 | void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ | 295 | void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ |
296 | { | 296 | { |
297 | unsigned int n; | 297 | unsigned int n; |
298 | char str[32]; | ||
299 | 298 | ||
300 | asm volatile ("sts\tpr,%0" : "=r"(n)); | 299 | asm volatile ("sts\tpr,%0" : "=r"(n)); |
301 | 300 | ||
302 | /* clear screen */ | 301 | /* clear screen */ |
303 | lcd_clear_display (); | 302 | lcd_clear_display(); |
304 | #ifdef HAVE_LCD_BITMAP | 303 | #ifdef HAVE_LCD_BITMAP |
305 | lcd_setfont(FONT_SYSFIXED); | 304 | lcd_setfont(FONT_SYSFIXED); |
306 | #endif | 305 | #endif |
307 | /* output exception */ | 306 | /* output exception */ |
308 | n = (n - (unsigned)UIE4 + 12)>>2; /* get exception or interrupt number */ | 307 | n = (n - (unsigned)UIE4 + 12)>>2; /* get exception or interrupt number */ |
309 | snprintf(str,sizeof(str),"I%02x:%s",n,irqname[n]); | 308 | lcd_putsf(0, 0, "I%02x:%s", n, irqname[n]); |
310 | lcd_puts(0,0,str); | 309 | lcd_putsf(0, 1, "at %08x", pc); |
311 | snprintf(str,sizeof(str),"at %08x",pc); | 310 | lcd_update(); |
312 | lcd_puts(0,1,str); | ||
313 | lcd_update (); | ||
314 | 311 | ||
315 | /* try to restart firmware if ON is pressed */ | 312 | /* try to restart firmware if ON is pressed */ |
316 | system_exception_wait(); | 313 | system_exception_wait(); |