Fix up the bootloaders
They can't access the raw RBVERSION define any longer.
Change-Id: I698062b36306399945c01de54cdccaa1a1a8434e
diff --git a/bootloader/creativezvm.c b/bootloader/creativezvm.c
index f3a3960..f31f649 100644
--- a/bootloader/creativezvm.c
+++ b/bootloader/creativezvm.c
@@ -68,7 +68,7 @@
lcd_setfont(FONT_SYSFIXED);
reset_screen();
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
ret = storage_init();
if(ret)
diff --git a/bootloader/gigabeat-s.c b/bootloader/gigabeat-s.c
index 50ff12d..3b852db 100644
--- a/bootloader/gigabeat-s.c
+++ b/bootloader/gigabeat-s.c
@@ -354,7 +354,7 @@
verbose = true;
printf("Gigabeat S Rockbox Bootloader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
adc_init();
batt = _battery_voltage();
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c
index f995be0..52f55a5 100644
--- a/bootloader/gigabeat.c
+++ b/bootloader/gigabeat.c
@@ -174,7 +174,7 @@
verbose = true;
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
sleep(50); /* ATA seems to error without this pause */
diff --git a/bootloader/iaudio_coldfire.c b/bootloader/iaudio_coldfire.c
index da7a7af..013e885 100644
--- a/bootloader/iaudio_coldfire.c
+++ b/bootloader/iaudio_coldfire.c
@@ -188,7 +188,7 @@
}
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
check_battery();
diff --git a/bootloader/imx233.c b/bootloader/imx233.c
index f0d6aa0..d2562d0 100644
--- a/bootloader/imx233.c
+++ b/bootloader/imx233.c
@@ -154,7 +154,7 @@
button_init();
- printf("%s: %s", MSG(240, "Ver", "Boot version"), RBVERSION);
+ 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
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index cae2501..b2d4532 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -334,7 +334,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: " RBVERSION);
+ printf("Version: %s", rbversion);
printf("IPOD version: 0x%08x", IPOD_HW_REVISION);
i=ata_init();
diff --git a/bootloader/ipodnano2g.c b/bootloader/ipodnano2g.c
index f3be7ae..cdd866f 100644
--- a/bootloader/ipodnano2g.c
+++ b/bootloader/ipodnano2g.c
@@ -204,7 +204,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: " RBVERSION);
+ printf("Version: %s", rbversion);
i = storage_init();
diff --git a/bootloader/iriver_h1x0.c b/bootloader/iriver_h1x0.c
index 61077f3..7f236d4 100644
--- a/bootloader/iriver_h1x0.c
+++ b/bootloader/iriver_h1x0.c
@@ -254,7 +254,7 @@
extern int line;
reset_screen();
- printf("Bootloader " RBVERSION);
+ printf("Bootloader %s", rbversion);
check_battery();
printf("=========================");
line += FAILSAFE_OPTIONS;
@@ -502,7 +502,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
/* No need to wait here more because lcd_init and others already do that. */
// sleep(HZ/50); /* Allow the button driver to check the buttons */
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index 2f53d03..362eb94 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -210,7 +210,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
sleep(HZ/50); /* Allow the button driver to check the buttons */
rec_button = ((button_status() & BUTTON_REC) == BUTTON_REC)
diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c
index c24f5c0..490f1f0 100644
--- a/bootloader/main-e200r-installer.c
+++ b/bootloader/main-e200r-installer.c
@@ -112,7 +112,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox e200R installer");
- printf("Version: " RBVERSION);
+ printf("Version: %s", rbversion);
printf(MODEL_NAME);
printf("");
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 9f7b88c..38760a0 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -349,7 +349,7 @@
lcd_setfont(FONT_SYSFIXED);
printf("Rockbox boot loader");
- printf("Version: " RBVERSION);
+ printf("Version: %s", rbversion);
printf(MODEL_NAME);
i=storage_init();
diff --git a/bootloader/mini2440.c b/bootloader/mini2440.c
index 4976318..b3d73d1 100644
--- a/bootloader/mini2440.c
+++ b/bootloader/mini2440.c
@@ -79,7 +79,7 @@
verbose = true;
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
rc = storage_init();
if(rc)
diff --git a/bootloader/mpio_hd200_hd300.c b/bootloader/mpio_hd200_hd300.c
index 963e65f..a4e13e1 100644
--- a/bootloader/mpio_hd200_hd300.c
+++ b/bootloader/mpio_hd200_hd300.c
@@ -196,7 +196,7 @@
reset_screen();
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
rc = storage_init();
if(rc)
@@ -234,7 +234,7 @@
/* backbone of menu */
/* run the loader */
printf("Rockbox boot loader");
- printf("Ver: " RBVERSION);
+ printf("Ver: %s", rbversion);
check_battery();
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index 1b00e12..0b9ffb6 100644
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -85,7 +85,7 @@
verbose = true;
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
/* Enter USB mode without USB thread */
if(usb_detect() == USB_INSERTED)
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 0c189ea..3d03c36 100644
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -297,7 +297,7 @@
if(verbose)
reset_screen();
printf(MODEL_NAME" Rockbox Bootloader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
#ifdef HAS_BUTTON_HOLD
if(button_hold())
diff --git a/bootloader/rk27xx.c b/bootloader/rk27xx.c
index dae738e..d190ea5 100644
--- a/bootloader/rk27xx.c
+++ b/bootloader/rk27xx.c
@@ -159,7 +159,7 @@
else if (boot == of)
snprintf(filename,sizeof(filename), BOOTDIR "/%s", "BASE.RKW");
- printf("Bootloader version: %s", RBVERSION);
+ printf("Bootloader version: %s", rbversion);
printf("Loading: %s", filename);
ret = load_rkw(loadbuffer, filename, LOAD_SIZE);
diff --git a/bootloader/sansaconnect.c b/bootloader/sansaconnect.c
index 280c386..48617ec 100644
--- a/bootloader/sansaconnect.c
+++ b/bootloader/sansaconnect.c
@@ -66,7 +66,7 @@
btn = button_read_device();
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
ret = storage_init();
if(ret)
diff --git a/bootloader/show_logo.c b/bootloader/show_logo.c
index 538e902..6584e3f 100644
--- a/bootloader/show_logo.c
+++ b/bootloader/show_logo.c
@@ -28,14 +28,14 @@
#include "bitmaps/rockboxlogo.h"
#if LCD_WIDTH <= 128
-#define BOOT_VERSION ("Boot " RBVERSION)
+#define BOOT_VERFMT "Boot %s"
#else
-#define BOOT_VERSION ("Boot Ver. " RBVERSION)
+#define BOOT_VERFMT "Boot Ver. %s"
#endif
/* Ensure TEXT_XPOS is >= 0 */
-#define TEXT_WIDTH ((sizeof(BOOT_VERSION)-1)*SYSFONT_WIDTH)
-#define TEXT_XPOS ((TEXT_WIDTH > LCD_WIDTH) ? 0 : ((LCD_WIDTH - TEXT_WIDTH) / 2))
+#define TEXT_WIDTH(l) ((l)*SYSFONT_WIDTH)
+#define TEXT_XPOS(w) (((w) > LCD_WIDTH) ? 0 : ((LCD_WIDTH - (w)) / 2))
#define LOGO_XPOS ((LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2)
void show_logo( void )
@@ -43,14 +43,19 @@
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
+ char verstr[strlen(rbversion) + sizeof (BOOT_VERFMT)];
+ int len = snprintf(verstr, sizeof(verstr), BOOT_VERFMT, rbversion);
+ int text_width = TEXT_WIDTH(len);
+ int text_xpos = TEXT_XPOS(text_width);
+
#if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS)
/* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48
are blue, so we reverse the usual positioning */
- lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION);
+ lcd_putsxy(text_xpos, 0, verstr);
lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 16);
#else
lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 10);
- lcd_putsxy(TEXT_XPOS, LCD_HEIGHT-SYSFONT_HEIGHT, BOOT_VERSION);
+ lcd_putsxy(text_xpos, LCD_HEIGHT-SYSFONT_HEIGHT, verstr);
#endif
lcd_update();
diff --git a/bootloader/telechips.c b/bootloader/telechips.c
index 77aa398..17ba509 100644
--- a/bootloader/telechips.c
+++ b/bootloader/telechips.c
@@ -152,7 +152,7 @@
available for loading the firmware. Otherwise display the debug screen. */
#ifdef TCCBOOT
printf("Rockbox boot loader");
- printf("Version " RBVERSION);
+ printf("Version %s", rbversion);
printf("ATA");
rc = storage_init();