-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathplic_test.c
57 lines (35 loc) · 945 Bytes
/
plic_test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "gpio.h"
#include "trap.h"
#include "timer.h"
#include "platform.h"
#include "plic.h"
#include "plic-regs.h"
// void handle_button_press(__attribute__((unused)) uint32_t num);
// void handle_button_press(__attribute__((unused)) uint32_t num)
// {
// uint32_t state = gpio_read_pin(5);
// if(state == 0)
// gpio_direct_write(10, 1);
// }
int main(void){
// gpio_intr_enable(3);
// gpio_intr_type(3);
// plic_init(13);
gpio_direct_write_enable(6);
gpio_direct_write(6, 1);
delay(11000000);
gpio_direct_write_enable(7);
gpio_direct_write(7, 1);
delay(11000000);
gpio_direct_write_enable(8);
gpio_direct_write(8, 1);
// // Enable Global (PLIC) interrupts.
// asm volatile("li t0, 8\t\n"
// "csrrs zero, mstatus, t0\t\n"
// );
// // Enable Local (PLIC) interrupts.
// asm volatile("li t0, 0x800\t\n"
// "csrrs zero, mie, t0\t\n"
// );
// return 0;
}