-
Notifications
You must be signed in to change notification settings - Fork 19
/
spin_exinterupt.c
44 lines (38 loc) · 1.17 KB
/
spin_exinterupt.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
#include"spin_exinterupt.h"
static uint* local_exint_dev0_callback;
static uint* local_exint_dev1_callback;
static uint spin_exint0_local_callback(){
//todo
inter_vector_function[out_int0] = local_exint_dev0_callback;
((interupt_callback)inter_vector_function[out_int0])();
return spin_ok;
}
static uint spin_exint1_local_callback(){
//todo
inter_vector_function[out_int1] = local_exint_dev1_callback;
((interupt_callback)inter_vector_function[out_int1])();
return spin_ok;
}
void spin_exint0_start(TRIGER_TYPES type){
//ÐÞ¸ÄÖжϻص÷º¯ÊýÈë¿Ú
local_exint_dev0_callback = inter_vector_function[out_int0];
inter_vector_function[out_int0] = (uchar *)spin_exint0_local_callback;
IT0 = type;
spin_interupt_init();
spin_interupt_enable();
spin_interupt_open(out_int0,high);
}
void spin_exint1_start(TRIGER_TYPES type){
local_exint_dev1_callback = inter_vector_function[out_int1];
inter_vector_function[out_int1] = (uchar *)spin_exint1_local_callback;
IT1 = type;
spin_interupt_init();
spin_interupt_enable();
spin_interupt_open(out_int1,high);
}
void spin_exint0_stop(){
spin_interupt_close(out_int0);
}
void spin_exint1_stop(){
spin_interupt_close(out_int1);
}