summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-08-28 23:12:11 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-08-28 23:12:11 +0000
commitbc4b5366cd2863904abae103f0e198dd6952e438 (patch)
tree45bf8ec407edb1dfea9a7bb00568283f02291e1f /firmware
parent71b2d2811b8cd8747f81a2e69e07aaa72a56b1c2 (diff)
downloadrockbox-bc4b5366cd2863904abae103f0e198dd6952e438.tar.gz
rockbox-bc4b5366cd2863904abae103f0e198dd6952e438.zip
firmware/ : use lcd_putsf() (only in debug code)
ata-meg-fx: use unsigned line number, so % (modulo) is optimized tcc7*: use proper printf format and remove casting git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27935 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/ifp_usb_serial.c5
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c6
-rw-r--r--firmware/target/arm/tcc77x/debug-tcc77x.c19
-rw-r--r--firmware/target/arm/tcc780x/debug-tcc780x.c22
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c10
5 files changed, 19 insertions, 43 deletions
diff --git a/firmware/ifp_usb_serial.c b/firmware/ifp_usb_serial.c
index 530f2c122b..5392de0d52 100644
--- a/firmware/ifp_usb_serial.c
+++ b/firmware/ifp_usb_serial.c
@@ -988,10 +988,7 @@ static void serial_restart_output(int ep)
988 if (blen) 988 if (blen)
989 { 989 {
990#ifdef LCD_DEBUG 990#ifdef LCD_DEBUG
991 char s[20]; 991 lcd_putsf(0, 2, "o%03lx/%03x", block - serial_out_fifo.buf, blen);
992 snprintf(s, sizeof(s), "o%03lx/%03x", block - serial_out_fifo.buf,
993 blen);
994 lcd_puts(0, 2, s);
995 lcd_update(); 992 lcd_update();
996#endif 993#endif
997 usb_send_block(block, blen, serial_free_out_fifo, ep); 994 usb_send_block(block, blen, serial_free_out_fifo, ep);
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c
index 4b1e1d9ccc..8cd0260fe4 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/ata-meg-fx.c
@@ -95,10 +95,8 @@ void copy_read_sectors(unsigned char* buf, int wordcount)
95 95
96//#define GIGABEAT_DEBUG_ATA 96//#define GIGABEAT_DEBUG_ATA
97#ifdef GIGABEAT_DEBUG_ATA 97#ifdef GIGABEAT_DEBUG_ATA
98 static int line = 0; 98 static unsigned line = 0;
99 static char str[256]; 99 lcd_putsf(10, line, "ODD DMA to %08x, %d", buf, wordcount);
100 snprintf(str, sizeof(str), "ODD DMA to %08x, %d", buf, wordcount);
101 lcd_puts(10, line, str);
102 line = (line+1) % 32; 100 line = (line+1) % 32;
103 lcd_update(); 101 lcd_update();
104#endif 102#endif
diff --git a/firmware/target/arm/tcc77x/debug-tcc77x.c b/firmware/target/arm/tcc77x/debug-tcc77x.c
index cf98451329..20d6954b03 100644
--- a/firmware/target/arm/tcc77x/debug-tcc77x.c
+++ b/firmware/target/arm/tcc77x/debug-tcc77x.c
@@ -40,7 +40,6 @@ bool __dbg_hw_info(void)
40{ 40{
41 int line = 0, i, button, oldline; 41 int line = 0, i, button, oldline;
42 bool done=false; 42 bool done=false;
43 char buf[100];
44 43
45 lcd_setfont(FONT_SYSFIXED); 44 lcd_setfont(FONT_SYSFIXED);
46 lcd_clear_display(); 45 lcd_clear_display();
@@ -63,21 +62,15 @@ bool __dbg_hw_info(void)
63#endif 62#endif
64 done=true; 63 done=true;
65 64
66 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d", 65 lcd_putsf(0, line++, "current tick: %08lx Seconds running: %08ld",
67 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf); 66 current_tick, current_tick/HZ);
68 67
69 snprintf(buf, sizeof(buf), "GPIOA: 0x%08x GPIOB: 0x%08x", 68 lcd_putsf(0, line++, "GPIOA: 0x%08lx GPIOB: 0x%08lx", GPIOA, GPIOB);
70 (unsigned int)GPIOA, (unsigned int)GPIOB); lcd_puts(0, line++, buf); 69 lcd_putsf(0, line++, "GPIOC: 0x%08lx GPIOD: 0x%08lx", GPIOC, GPIOD);
71 snprintf(buf, sizeof(buf), "GPIOC: 0x%08x GPIOD: 0x%08x", 70 lcd_putsf(0, line++, "GPIOE: 0x%08lx", GPIOE);
72 (unsigned int)GPIOC, (unsigned int)GPIOD); lcd_puts(0, line++, buf);
73 snprintf(buf, sizeof(buf), "GPIOE: 0x%08x",
74 (unsigned int)GPIOE); lcd_puts(0, line++, buf);
75 71
76 for (i = 0; i<4; i++) 72 for (i = 0; i<4; i++)
77 { 73 lcd_putsf(0, line++, "ADC%d: 0x%04x", i, adc_read(i));
78 snprintf(buf, sizeof(buf), "ADC%d: 0x%04x", i, adc_read(i));
79 lcd_puts(0, line++, buf);
80 }
81 74
82 lcd_update(); 75 lcd_update();
83 } 76 }
diff --git a/firmware/target/arm/tcc780x/debug-tcc780x.c b/firmware/target/arm/tcc780x/debug-tcc780x.c
index 3afc5fafab..9267307e05 100644
--- a/firmware/target/arm/tcc780x/debug-tcc780x.c
+++ b/firmware/target/arm/tcc780x/debug-tcc780x.c
@@ -43,7 +43,6 @@ bool __dbg_ports(void)
43bool __dbg_hw_info(void) 43bool __dbg_hw_info(void)
44{ 44{
45 int line = 0, i, oldline; 45 int line = 0, i, oldline;
46 char buf[100];
47 46
48 lcd_setfont(FONT_SYSFIXED); 47 lcd_setfont(FONT_SYSFIXED);
49 lcd_clear_display(); 48 lcd_clear_display();
@@ -61,24 +60,17 @@ bool __dbg_hw_info(void)
61 if (button_get_w_tmo(HZ/20) == (BUTTON_POWER|BUTTON_REL)) 60 if (button_get_w_tmo(HZ/20) == (BUTTON_POWER|BUTTON_REL))
62 break; 61 break;
63 62
64 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d", 63 lcd_putsf(0, line++, "current tick: %08lx Seconds running: %08ld",
65 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf); 64 current_tick, current_tick/HZ);
66 65
67 snprintf(buf, sizeof(buf), "GPIOA: 0x%08x GPIOB: 0x%08x", 66 lcd_putsf(0, line++, "GPIOA: 0x%08lx GPIOB: 0x%08lx", GPIOA, GPIOB);
68 (unsigned int)GPIOA, (unsigned int)GPIOB); lcd_puts(0, line++, buf); 67 lcd_putsf(0, line++, "GPIOC: 0x%08lx GPIOD: 0x%08lx", GPIOC, GPIOD);
69 snprintf(buf, sizeof(buf), "GPIOC: 0x%08x GPIOD: 0x%08x", 68 lcd_putsf(0, line++, "GPIOE: 0x%08lx", GPIOE);
70 (unsigned int)GPIOC, (unsigned int)GPIOD); lcd_puts(0, line++, buf);
71 snprintf(buf, sizeof(buf), "GPIOE: 0x%08x",
72 (unsigned int)GPIOE); lcd_puts(0, line++, buf);
73 69
74 for (i = 0; i<4; i++) 70 for (i = 0; i<4; i++)
75 { 71 lcd_putsf(0, line++, "ADC%d: 0x%04x", i, adc_read(i));
76 snprintf(buf, sizeof(buf), "ADC%d: 0x%04x", i, adc_read(i));
77 lcd_puts(0, line++, buf);
78 }
79 72
80 snprintf(buf, sizeof(buf), "STS: 0x%08x SRC: 0x%08x", 73 lcd_putsf(0, line++, "STS: 0x%08lx SRC: 0x%08lx", STS, SRC);
81 (unsigned int)STS, (unsigned int)SRC); lcd_puts(0, line++, buf);
82 74
83 lcd_update(); 75 lcd_update();
84 } 76 }
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
index d910eeb3b6..ab5462fa90 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
@@ -255,18 +255,14 @@ void GIO0(void)
255 break; 255 break;
256 } 256 }
257#ifdef BUTTON_DEBUG 257#ifdef BUTTON_DEBUG
258 unsigned char weergvn[10];
259#ifdef BOOTLOADER 258#ifdef BOOTLOADER
260 lcd_set_foreground((sw ? LCD_RGBPACK(255,0,0) : LCD_RGBPACK(0,255,0) )); 259 lcd_set_foreground((sw ? LCD_RGBPACK(255,0,0) : LCD_RGBPACK(0,255,0) ));
261#endif 260#endif
262 snprintf(weergvn, sizeof(char)*10, "%x", 261 lcd_putsxyf(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*10, "%x",
263 (unsigned int)((msg[3] << 24) | 262 (unsigned int)((msg[3] << 24) |
264 (msg[2] << 16) | (msg[1] << 8) | msg[0])); 263 (msg[2] << 16) | (msg[1] << 8) | msg[0]));
265 lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*10, 264 lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*7, "%x",
266 weergvn); 265 btn);
267 snprintf(weergvn, sizeof(char)*10, "%x", btn);
268 lcd_putsxy(LCD_WIDTH-SYSFONT_WIDTH*10, LCD_HEIGHT-SYSFONT_HEIGHT*7,
269 weergvn);
270#ifdef BOOTLOADER 266#ifdef BOOTLOADER
271 lcd_set_foreground(LCD_BLACK); 267 lcd_set_foreground(LCD_BLACK);
272#endif 268#endif