void power_off(void) { int(*reboot_point)(void); reboot_point=(void*)(unsigned char*) 0x00000000; /* turn off backlight and wait for 1 second */ _backlight_off(); _buttonlight_off(); sleep(HZ); /* Do this to allow the drive to properly reset when player restarts * immediately without running OF shutdown. */ GPGCON&=~0x00300000; /* Rockbox never properly shutdown the player. When the sleep bit is set * the player actually wakes up in some type of "zombie" state * because the shutdown routine is not set up properly. So far the * shutdown routines tried leave the player consuming excess power * so we rely on the OF to shut everything down instead. (mmu apears to be * reset when the sleep bit is set) */ CLKCON |=(1<<3); reboot_point(); }
void _backlight_set_brightness(int brightness) { backlight_level = brightness_table[brightness]; if (brightness > 0) _backlight_on(); else _backlight_off(); }
void system_reboot(void) { _backlight_off(); disable_irq(); imx233_chip_reset(); while(1); }
void system_reboot(void) { _backlight_off(); disable_irq(); /* use watchdog to reset */ imx233_chip_reset(); while(1); }
void power_off(void) { /* turn off backlight and wait for 1 second */ _backlight_off(); #if defined(HAVE_REMOTE_LCD) lcd_remote_sleep(); #endif lcd_sleep(); sleep(HZ); /* Hard shutdown */ IO_GIO_BITSET1 = 1<<10; }
/* Turn off LED supply */ void _backlight_lcd_sleep(void) { _backlight_off(); }
/* The following function is just test/development code */ void show_debug_screen(void) { int button; int power_count = 0; int count = 0; bool do_power_off = false; lcd_puts_scroll(0,0,"+++ this is a very very long line to test scrolling. ---"); while (!do_power_off) { line = 1; button = button_get(false); /* Power-off if POWER button has been held for a time This loop is currently running at about 100 iterations/second */ if (button & POWEROFF_BUTTON) { power_count++; if (power_count > 100) do_power_off = true; } else { power_count = 0; } #if 0 if (button & BUTTON_SELECT){ _backlight_off(); } else{ _backlight_on(); } #endif printf("Btn: 0x%08x",button); #if 0 printf("Tick: %d",current_tick); printf("GPIOA: 0x%08x",GPIOA); printf("GPIOB: 0x%08x",GPIOB); printf("GPIOC: 0x%08x",GPIOC); printf("GPIOD: 0x%08x",GPIOD); printf("GPIOE: 0x%08x",GPIOE); #endif #if 0 int i; for (i = 0; i<4; i++) { printf("ADC%d: 0x%04x",i,adc_read(i)); } #endif count++; printf("Count: %d",count); lcd_update(); sleep(HZ/10); } lcd_clear_display(); line = 0; printf("POWER-OFF"); /* Power-off */ power_off(); printf("(NOT) POWERED OFF"); while (true); }