1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by wavey@wavey.org
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
32 static char panic_buf
[128];
35 * "Dude. This is pretty fucked-up, right here."
37 void panicf( const char *fmt
, ...)
42 #if (CONFIG_LED == LED_REAL)
47 /* Disable interrupts */
52 set_irq_level(DISABLE_INTERRUPTS
);
53 #endif /* SIMULATOR */
56 vsnprintf( panic_buf
, sizeof(panic_buf
), fmt
, ap
);
59 #ifdef HAVE_LCD_CHARCELLS
60 lcd_double_height(false);
61 lcd_puts(0, 0, "*PANIC*");
62 lcd_puts(0, 1, panic_buf
);
63 #elif defined(HAVE_LCD_BITMAP)
65 lcd_setfont(FONT_SYSFIXED
);
66 lcd_puts(0, 0, (unsigned char *)"*PANIC*");
69 int i
, y
=1, len
= strlen(panic_buf
);
70 for (i
=0; i
<len
; i
+=18) {
71 unsigned char c
= panic_buf
[i
+18];
73 lcd_puts(0, y
++, (unsigned char *)panic_buf
+i
);
85 #ifdef HAVE_ATA_POWER_OFF
86 ide_power_enable(false);
92 #if (CONFIG_LED == LED_REAL)
101 /* try to restart firmware if ON is pressed */
103 /* For now, just sleep the core */
104 if (CURRENT_CORE
== CPU
)
105 CPU_CTL
= PROC_SLEEP
;
107 COP_CTL
= PROC_SLEEP
;
108 #define system_reboot() nop
109 #elif defined (TOSHIBA_GIGABEAT_F)
110 if ((GPGDAT
& (1 << 0)) != 0)
111 #elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES)
112 if ((GPIO1_READ
& 0x22) == 0) /* check for ON button and !hold */
113 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
114 if ((GPIO_READ
& 0x0c000000) == 0x08000000) /* check for ON button and !hold */
115 #elif defined(IAUDIO_M3)
116 if ((GPIO1_READ
& 0x202) == 0x200) /* check for ON button and !hold */
117 #elif CONFIG_CPU == SH7034
118 #if CONFIG_KEYPAD == PLAYER_PAD
120 #elif CONFIG_KEYPAD == RECORDER_PAD
122 if (!(PCDR
& 0x0008))
126 #elif CONFIG_KEYPAD == ONDIO_PAD
127 if (!(PCDR
& 0x0008))
128 #endif /* CONFIG_KEYPAD */
131 #endif /* !SIMULATOR */