1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by wavey@wavey.org
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
34 static char panic_buf
[128];
37 * "Dude. This is pretty fucked-up, right here."
39 void panicf( const char *fmt
, ...)
44 #if (CONFIG_LED == LED_REAL)
49 /* Disable interrupts */
54 set_irq_level(DISABLE_INTERRUPTS
);
55 #endif /* SIMULATOR */
58 vsnprintf( panic_buf
, sizeof(panic_buf
), fmt
, ap
);
61 #ifdef HAVE_LCD_CHARCELLS
62 lcd_double_height(false);
63 lcd_puts(0, 0, "*PANIC*");
64 lcd_puts(0, 1, panic_buf
);
65 #elif defined(HAVE_LCD_BITMAP)
67 lcd_setfont(FONT_SYSFIXED
);
68 lcd_puts(0, 0, (unsigned char *)"*PANIC*");
71 int i
, y
=1, len
= strlen(panic_buf
);
72 for (i
=0; i
<len
; i
+=18) {
73 unsigned char c
= panic_buf
[i
+18];
75 lcd_puts(0, y
++, (unsigned char *)panic_buf
+i
);
87 #ifdef HAVE_ATA_POWER_OFF
88 ide_power_enable(false);
94 #if (CONFIG_LED == LED_REAL)
103 /* try to restart firmware if ON is pressed */
105 /* For now, just sleep the core */
106 sleep_core(CURRENT_CORE
);
107 #define system_reboot() nop
108 #elif defined (TOSHIBA_GIGABEAT_F)
109 if ((GPGDAT
& (1 << 0)) != 0)
110 #elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
111 if ((GPIO1_READ
& 0x22) == 0) /* check for ON button and !hold */
112 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
113 if ((GPIO_READ
& 0x0c000000) == 0x08000000) /* check for ON button and !hold */
114 #elif defined(IAUDIO_M3)
115 if ((GPIO1_READ
& 0x202) == 0x200) /* check for ON button and !hold */
116 #elif defined(COWON_D2)
117 if (GPIOA
& 0x10) /* check for power button */
118 #elif CONFIG_CPU == SH7034
119 #if CONFIG_KEYPAD == PLAYER_PAD
121 #elif CONFIG_KEYPAD == RECORDER_PAD
123 if (!(PCDR
& 0x0008))
127 #elif CONFIG_KEYPAD == ONDIO_PAD
128 if (!(PCDR
& 0x0008))
129 #endif /* CONFIG_KEYPAD */
130 #elif defined(CREATIVE_ZVx)
134 #endif /* !SIMULATOR */