OpenCores
URL https://opencores.org/ocsvn/mips32r1/mips32r1/trunk

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Software/] [demos/] [XD2_Timer/] [src/] [os/] [exception_handler.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
#include "drivers/lcd.h"
2
#include "drivers/piezo.h"
3
 
4
void dead_loop(void)
5
{
6
        for (;;) {}
7
}
8
 
9
void mips32_handler_AdEL(void)
10
{
11
        LCD_clear();
12
        LCD_printString("AdEL");
13
        dead_loop();
14
}
15
 
16
void mips32_handler_AdES(void)
17
{
18
        LCD_clear();
19
        LCD_printString("AdES");
20
        dead_loop();
21
}
22
 
23
void mips32_handler_Bp(void)
24
{
25
        LCD_clear();
26
        LCD_printString("Bp");
27
        dead_loop();
28
}
29
 
30
void mips32_handler_CpU(void)
31
{
32
        LCD_clear();
33
        LCD_printString("CpU");
34
        dead_loop();
35
}
36
 
37
void mips32_handler_Ov(void)
38
{
39
        LCD_clear();
40
        LCD_printString("Ov");
41
        dead_loop();
42
}
43
 
44
void mips32_handler_RI(void)
45
{
46
        LCD_clear();
47
        LCD_printString("RI");
48
        dead_loop();
49
}
50
 
51
void mips32_handler_Sys(void)
52
{
53
        LCD_clear();
54
        LCD_printString("Sys");
55
        dead_loop();
56
}
57
 
58
void mips32_handler_Tr(void)
59
{
60
        LCD_clear();
61
        LCD_printString("Trap");
62
        dead_loop();
63
}
64
 
65
/* Timer */
66
void mips32_handler_HwInt5(void)
67
{
68
        static volatile char blink = 0;
69
        static volatile char wait = 0;
70
 
71
        if (blink == 0) {
72
                blink++;
73
                LCD_setPos(15);
74
                LCD_printByte(' ');
75
        }
76
        else {
77
                blink--;
78
                LCD_setPos(15);
79
                LCD_printByte('.');
80
        }
81
 
82
        if (wait == 1) {
83
                wait++;
84
                Piezo_set(0, 0);
85
        }
86
        else if (wait < 1) {
87
                wait++;
88
        }
89
}
90
 
91
void mips32_handler_HwInt4(void)
92
{
93
        static volatile char count = 0;
94
 
95
        LCD_printByte(count);
96
        count++;
97
}
98
 
99
void mips32_handler_HwInt3(void)
100
{
101
        static volatile char count = 0;
102
 
103
        LCD_printByte(count);
104
        count++;
105
}
106
 
107
void mips32_handler_HwInt2(void)
108
{
109
        static volatile char count = 0;
110
 
111
        LCD_printByte(count);
112
        count++;
113
}
114
 
115
void mips32_handler_HwInt1(void)
116
{
117
        static volatile char count = 0;
118
 
119
        LCD_printByte(count);
120
        count++;
121
}
122
 
123
 
124
void mips32_handler_HwInt0(void)
125
{
126
        static volatile char count = 0;
127
 
128
        LCD_printByte(count);
129
        count++;
130
}
131
 
132
void mips32_handler_SwInt1(void)
133
{
134
        static volatile char count = 0;
135
 
136
        LCD_printByte(count);
137
        count++;
138
}
139
 
140
void mips32_handler_SwInt0(void)
141
{
142
        static volatile char count = 0;
143
 
144
        LCD_printByte(count);
145
        count++;
146
}
147
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.