From 7e03dbbf941a7f18f7dc32980e406adfb0a1f288 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 25 Sep 2013 14:11:56 +0200 Subject: imx233: shorten bootloader messages when screen is small Change-Id: I403a76277e756cf06b4dca4906940d5fbf32d763 --- bootloader/imx233.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bootloader/imx233.c b/bootloader/imx233.c index abb9df833b..ebd67cea6c 100644 --- a/bootloader/imx233.c +++ b/bootloader/imx233.c @@ -50,6 +50,8 @@ extern char loadaddress[]; extern char loadaddressend[]; +#define MSG(width, short, long) (LCD_WIDTH < (width) ? short : long) + #ifdef HAVE_BOOTLOADER_USB_MODE static void usb_mode(int connect_timeout) { @@ -98,7 +100,7 @@ static void usb_mode(int connect_timeout) if(button == SYS_USB_DISCONNECTED) break; struct imx233_powermgmt_info_t info = imx233_powermgmt_get_info(); - lcd_putsf(0, 7, "Charging status: %s", + lcd_putsf(0, 7, "%s: %s", MSG(240, "Status", "Charging status"), info.state == CHARGE_STATE_DISABLED ? "disabled" : info.state == CHARGE_STATE_ERROR ? "error" : info.state == DISCHARGING ? "discharging" : @@ -106,11 +108,11 @@ static void usb_mode(int connect_timeout) info.state == TOPOFF ? "topoff" : info.state == CHARGING ? "charging" : ""); lcd_putsf(0, 8, "Battery: %d%% (%d mV)", battery_level(), battery_voltage()); - lcd_putsf(0, 9, "Die temp: %d°C [%d, %d]", + lcd_putsf(0, 9, "%s: %d 'C [%d, %d]", MSG(240, "Die", "Die temp"), adc_read(ADC_DIE_TEMP), IMX233_DIE_TEMP_HIGH, IMX233_DIE_TEMP_LOW); #ifdef ADC_BATT_TEMP - lcd_putsf(0, 10, "Batt temp: %d [%d, %d]", + lcd_putsf(0, 10, "%s: %d 'C [%d, %d]", MSG(240, "Batt", "Batt temp"), adc_read(ADC_BATT_TEMP), IMX233_BATT_TEMP_HIGH, IMX233_BATT_TEMP_LOW); #endif @@ -150,15 +152,16 @@ void main(uint32_t arg, uint32_t addr) button_init(); - printf("Boot version: %s", RBVERSION); - printf("arg=%x addr=%x", arg, addr); + printf("%s: %s", MSG(240, "Ver", "Boot version"), RBVERSION); + printf("%s: %x ", MSG(240, "Arg", "Boot arg"), arg); + printf("%s: %x", MSG(240, "Addr", "Boot addr"), addr); #if IMX233_SUBTARGET >= 3780 - printf("power up source: %x", BF_RD(POWER_STS, PWRUP_SOURCE)); + printf("Power up source: %x", BF_RD(POWER_STS, PWRUP_SOURCE)); #endif if(arg == 0xfee1dead) { - printf("Disable partitions window."); + printf("%s", MSG(240, "Disable window", "Disable partitions window")); imx233_partitions_enable_window(false); } -- cgit v1.2.3