void power_off(void)
{
#if defined(HAVE_LCD_COLOR) && !defined(HAVE_LCD_SHUTDOWN)
    /* Clear the screen and backdrop to
    remove ghosting effect on shutdown */
    lcd_set_backdrop(NULL);
    lcd_set_background(LCD_WHITE);
    lcd_clear_display();
    lcd_update();
    sleep(HZ/16);
#endif

#ifndef BOOTLOADER
#ifdef IPOD_1G2G
    /* we cannot turn off the 1st gen/ 2nd gen yet. Need to figure out sleep mode. */
    system_reboot();
#else
    /* We don't turn off the ipod, we put it in a deep sleep */
    /* Clear latter part of iram (the part used by plugins/codecs) to ensure
     * that the OF behaves properly on boot. There is some kind of boot
     * failure flag there which otherwise may not be cleared.
     */
#if CONFIG_CPU == PP5022
    memset((void*)0x4000c000, 0, 0x14000);
#elif CONFIG_CPU == PP5020
    memset((void*)0x4000c000, 0, 0xc000);
#endif
    pcf50605_standby_mode();
#endif
#endif
}
Exemplo n.º 2
0
static void show_skin_backdrop(void)
{
    /* if no wps backdrop, fall back to main backdrop */
    if(skin_backdrop_valid)
    {
        lcd_set_backdrop(&skin_backdrop[0][0]);
    }
    else
    {
        show_main_backdrop();
    }
}
Exemplo n.º 3
0
static void sig_handler(int sig, siginfo_t *siginfo, void *context)
{
    /* safe guard variable - we call backtrace() only on first
     * UIE call. This prevent endless loop if backtrace() touches
     * memory regions which cause abort
     */
    static bool triggered = false;

    lcd_set_backdrop(NULL);
    lcd_set_drawmode(DRMODE_SOLID);
    lcd_set_foreground(LCD_BLACK);
    lcd_set_background(LCD_WHITE);
    unsigned line = 0;

    lcd_setfont(FONT_SYSFIXED);
    lcd_set_viewport(NULL);
    lcd_clear_display();

    /* get context info */
    ucontext_t *uc = (ucontext_t *)context;
    unsigned long pc = uc->uc_mcontext.pc;
    unsigned long sp = uc->uc_mcontext.gregs[29];

    lcd_putsf(0, line++, "%s at %08x", strsignal(sig), pc);

    if(sig == SIGILL || sig == SIGFPE || sig == SIGSEGV || sig == SIGBUS || sig == SIGTRAP)
        lcd_putsf(0, line++, "address 0x%08x", siginfo->si_addr);

    if(!triggered)
    {
        triggered = true;
        rb_backtrace(pc, sp, &line);
    }

#ifdef ROCKBOX_HAS_LOGF
    lcd_putsf(0, line++, "logf:");
    logf_panic_dump(&line);
#endif

    lcd_update();

    system_exception_wait(); /* If this returns, try to reboot */
    system_reboot();
    while (1);       /* halt */
}
Exemplo n.º 4
0
void backdrop_show(char *backdrop_buffer)
{
    lcd_set_backdrop((fb_data*)backdrop_buffer);
}
Exemplo n.º 5
0
static inline void show_main_backdrop(void)
{
    lcd_set_backdrop(main_backdrop_valid ? &main_backdrop[0][0] : NULL);
}