From c468273e6d59ddf17c72d94a5d3c97df33c0f0ca Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Wed, 1 Jul 2009 14:39:39 +0000 Subject: Onda VX747: clean up bootloader a bit and make sure storage doesn't get init'd twice git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21593 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/common.c | 3 +-- bootloader/ondavx747.c | 44 ++++++++++++++++++-------------------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/bootloader/common.c b/bootloader/common.c index c9309a67db..4ac421d872 100644 --- a/bootloader/common.c +++ b/bootloader/common.c @@ -40,8 +40,7 @@ #if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined(IRIVER_H10_5GB) \ || defined(SANSA_E200) || defined(SANSA_C200) || defined(GIGABEAT_F) \ || defined(PHILIPS_SA9200) || (CONFIG_CPU == AS3525) || defined(COWON_D2) \ - || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(ONDA_VX747) \ - || defined(MROBE_500) + || defined(MROBE_100) || defined(PHILIPS_HDD1630) || defined(MROBE_500) bool verbose = false; #else bool verbose = true; diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c index 0b97a2e81c..6a04c1ba85 100755 --- a/bootloader/ondavx747.c +++ b/bootloader/ondavx747.c @@ -22,6 +22,7 @@ #include "config.h" #include "jz4740.h" #include "backlight.h" +#include "backlight-target.h" #include "font.h" #include "lcd.h" #include "usb.h" @@ -46,10 +47,7 @@ static void show_splash(int timeout, const char *msg) static void usb_mode(void) { int button; - - /* Init backlight */ - backlight_init(); - + /* Init USB */ usb_init(); usb_start_monitoring(); @@ -88,8 +86,7 @@ static void usb_mode(void) static void boot_of(void) { - /* Init backlight */ - backlight_init(); + /* Do nothing atm */ } int main(void) @@ -99,45 +96,38 @@ int main(void) int dummy; #endif void (*kernel_entry)(void); - + kernel_init(); lcd_init(); font_init(); lcd_setfont(FONT_SYSFIXED); button_init(); adc_init(); + backlight_init(); reset_screen(); - + printf(MODEL_NAME" Rockbox Bootloader"); + printf("Version "APPSVERSION); + + rc = storage_init(); + if(rc) + error(EATA, rc); + #ifdef HAVE_TOUCHSCREEN rc = button_read_device(&dummy); #else rc = button_read_device(); #endif - + if(rc & BUTTON_VOL_UP) usb_mode(); else if(button_hold()) boot_of(); - else if(rc) - verbose = true; - - /* Only enable backlight when button is pressed */ - if(verbose) - { - backlight_init(); - printf(MODEL_NAME" Rockbox Bootloader"); - printf("Version "APPSVERSION); - } - - rc = storage_init(); - if(rc) - error(EATA, rc); rc = disk_mount_all(); if (rc <= 0) error(EDISK,rc); - + printf("Loading firmware"); rc = load_firmware((unsigned char *)CONFIG_SDRAM_START, BOOTFILE, 0x400000); if(rc < 0) @@ -147,14 +137,16 @@ int main(void) { printf("Starting Rockbox..."); adc_close(); /* Disable SADC */ + _backlight_off(); /* Force backlight off to prevent LCD 'flicker' */ + disable_interrupt(); kernel_entry = (void*) CONFIG_SDRAM_START; kernel_entry(); } - + /* Halt */ while (1) core_idle(); - + return 0; } -- cgit v1.2.3