From bc4b5366cd2863904abae103f0e198dd6952e438 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sat, 28 Aug 2010 23:12:11 +0000 Subject: 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 --- firmware/target/arm/tcc77x/debug-tcc77x.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'firmware/target/arm/tcc77x/debug-tcc77x.c') 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) { int line = 0, i, button, oldline; bool done=false; - char buf[100]; lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); @@ -63,21 +62,15 @@ bool __dbg_hw_info(void) #endif done=true; - snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d", - (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf); + lcd_putsf(0, line++, "current tick: %08lx Seconds running: %08ld", + current_tick, current_tick/HZ); - snprintf(buf, sizeof(buf), "GPIOA: 0x%08x GPIOB: 0x%08x", - (unsigned int)GPIOA, (unsigned int)GPIOB); lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "GPIOC: 0x%08x GPIOD: 0x%08x", - (unsigned int)GPIOC, (unsigned int)GPIOD); lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "GPIOE: 0x%08x", - (unsigned int)GPIOE); lcd_puts(0, line++, buf); + lcd_putsf(0, line++, "GPIOA: 0x%08lx GPIOB: 0x%08lx", GPIOA, GPIOB); + lcd_putsf(0, line++, "GPIOC: 0x%08lx GPIOD: 0x%08lx", GPIOC, GPIOD); + lcd_putsf(0, line++, "GPIOE: 0x%08lx", GPIOE); for (i = 0; i<4; i++) - { - snprintf(buf, sizeof(buf), "ADC%d: 0x%04x", i, adc_read(i)); - lcd_puts(0, line++, buf); - } + lcd_putsf(0, line++, "ADC%d: 0x%04x", i, adc_read(i)); lcd_update(); } -- cgit v1.2.3