diff options
Diffstat (limited to 'firmware/system.c')
-rw-r--r-- | firmware/system.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/firmware/system.c b/firmware/system.c index 7da1034739..cc4a5f0c85 100644 --- a/firmware/system.c +++ b/firmware/system.c | |||
@@ -852,7 +852,9 @@ void (*vbr[]) (void) __attribute__ ((section (".vectors"))) = | |||
852 | 852 | ||
853 | void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ | 853 | void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ |
854 | { | 854 | { |
855 | #if CONFIG_LED == LED_REAL | ||
855 | bool state = true; | 856 | bool state = true; |
857 | #endif | ||
856 | unsigned int n; | 858 | unsigned int n; |
857 | char str[32]; | 859 | char str[32]; |
858 | 860 | ||
@@ -876,23 +878,31 @@ void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */ | |||
876 | 878 | ||
877 | while (1) | 879 | while (1) |
878 | { | 880 | { |
881 | #if CONFIG_LED == LED_REAL | ||
879 | volatile int i; | 882 | volatile int i; |
880 | led (state); | 883 | led (state); |
881 | state = state?false:true; | 884 | state = !state; |
882 | 885 | ||
883 | for (i = 0; i < 240000; ++i); | 886 | for (i = 0; i < 240000; ++i); |
887 | #endif | ||
884 | 888 | ||
885 | /* try to restart firmware if ON is pressed */ | 889 | /* try to restart firmware if ON is pressed */ |
886 | #if CONFIG_KEYPAD == PLAYER_PAD | 890 | #if CONFIG_KEYPAD == PLAYER_PAD |
887 | if (!(PADR & 0x0020)) | 891 | if (!(PADRL & 0x20)) |
888 | #elif CONFIG_KEYPAD == RECORDER_PAD | 892 | #elif CONFIG_KEYPAD == RECORDER_PAD |
889 | #ifdef HAVE_FMADC | 893 | #ifdef HAVE_FMADC |
890 | if (!(PCDR & 0x0008)) | 894 | if (!(PCDR & 0x0008)) |
891 | #else | 895 | #else |
892 | if (!(PBDR & 0x0100)) | 896 | if (!(PBDRH & 0x01)) |
893 | #endif | 897 | #endif |
898 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
899 | if (!(PCDR & 0x0008)) | ||
894 | #endif | 900 | #endif |
895 | system_reboot(); | 901 | { |
902 | /* enable the watchguard timer, but don't service it */ | ||
903 | RSTCSR_W = 0x5a40; /* Reset enabled, power-on reset */ | ||
904 | TCSR_W = 0xa560; /* Watchdog timer mode, timer enabled, sysclk/2 */ | ||
905 | } | ||
896 | } | 906 | } |
897 | } | 907 | } |
898 | 908 | ||