diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2008-11-12 04:15:34 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2008-11-12 04:15:34 +0000 |
commit | 59d4d2025c9f1b0a68b780fe6a6f0e313caf3027 (patch) | |
tree | 600746fc28046ddfc58498fd69d4afef8d40e419 /bootloader | |
parent | d42041043b95617244ffdb9150c5e2f2720a8a83 (diff) |
Revert last commit (accidentally committed the whole tree)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19095 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/gigabeat.c | 77 |
1 files changed, 4 insertions, 73 deletions
diff --git a/bootloader/gigabeat.c b/bootloader/gigabeat.c index 575e61c2fa..6b3a68be6e 100644 --- a/bootloader/gigabeat.c +++ b/bootloader/gigabeat.c @@ -44,29 +44,11 @@ #include "rbunicode.h" #include "usb.h" #include "mmu-arm.h" -#include "rtc.h" #include <stdarg.h> char version[] = APPSVERSION; -void shutdown(void) -{ - /* We need to gracefully spin down the disk to prevent clicks. */ - if (ide_powered()) - { - /* Make sure ATA has been initialized. */ - ata_init(); - - /* And put the disk into sleep immediately. */ - ata_sleepnow(); - } - - _backlight_off(); - - power_off(); -} - void main(void) { unsigned char* loadbuffer; @@ -74,67 +56,14 @@ void main(void) int rc; int(*kernel_entry)(void); + power_init(); system_init(); lcd_init(); backlight_init(); - button_init(); font_init(); - kernel_init(); /* Need the kernel to sleep */ - adc_init(); lcd_setfont(FONT_SYSFIXED); - - if(!(GPGDAT&BUTTON_POWER) && charger_inserted()) - { - while(!(GPGDAT&BUTTON_POWER) && charger_inserted()) - { - char msg[20]; - if(charging_state()) - { - snprintf(msg,sizeof(msg),"Charging"); - } - else - { - snprintf(msg,sizeof(msg),"Charge Complete"); - } - reset_screen(); - lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2, - (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg); - lcd_update(); - -#if defined(HAVE_RTC_ALARM) - /* Check if the alarm went off while charging */ - if(rtc_check_alarm_flag()) - { - GSTATUS4=1; /* Normally this is set in crt0.s */ - break; - } -#endif - } - if(!(GPGDAT&BUTTON_POWER) -#if defined(HAVE_RTC_ALARM) - && !GSTATUS4 -#endif - ) - { - shutdown(); - } - } - - if(button_hold()) - { - const char msg[] = "HOLD is enabled"; - reset_screen(); - lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2, - (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg); - lcd_update(); - - sleep(2*HZ); - - shutdown(); - } - power_init(); usb_init(); /* Enter USB mode without USB thread */ @@ -159,7 +88,9 @@ void main(void) lcd_update(); } - reset_screen(); + kernel_init(); + adc_init(); + button_init(); /* Show debug messages if button is pressed */ if(button_read_device()) |