summaryrefslogtreecommitdiff
path: root/firmware/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/system.c')
-rw-r--r--firmware/system.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/system.c b/firmware/system.c
index 87d3b9dc7d..3ec56f7c15 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -302,7 +302,7 @@ void (*vbr[]) (void) __attribute__ ((section (".vectors"))) =
302 302
303void system_reboot (void) 303void system_reboot (void)
304{ 304{
305 cli (); 305 set_irq_level(15);
306 306
307 asm volatile ("ldc\t%0,vbr" : : "r"(0)); 307 asm volatile ("ldc\t%0,vbr" : : "r"(0));
308 308
@@ -318,6 +318,18 @@ void system_reboot (void)
318 "r"(*(int*)0),"r"(4)); 318 "r"(*(int*)0),"r"(4));
319} 319}
320 320
321/****************************************************************************
322 * Interrupt level setting
323 ****************************************************************************/
324int set_irq_level(int level)
325{
326 int i;
327 /* Read the old level and set the new one */
328 asm volatile ("stc sr, %0" : "=r" (i));
329 asm volatile ("ldc %0, sr" : : "r" (level << 4));
330 return (i >> 4) & 0x0f;
331}
332
321void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ 333void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
322{ 334{
323 bool state = true; 335 bool state = true;