-
Notifications
You must be signed in to change notification settings - Fork 2
/
GPE_IRQ.c
39 lines (37 loc) · 1.26 KB
/
GPE_IRQ.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
/*=============================================================*
* _ _ ___ _ _ *
* | \| | _ _ | _ ) _ _ (_) __ | |__ *
* | .` | | +| | | _ \ | '_| | | / _| | / / *
* |_|\_| \_,_| |___/ _|_|_ _|_|_ \__|_ |_\_\ *
*_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| *
*"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' *
* *
* NuBrick IoT applications firmware *
* *
* Written by MB40 for Nuvoton Technology. *
* tlshen@nuvoton.com/tzulan611126@gmail.com *
* HCHEISH@nuvoton.com *
*=============================================================*
*/
#include "GPE_IRQ.h"
void GPE_IRQHandler(void)
{
/* To check if PE.0 interrupt occurred */
if(GPIO_GET_INT_FLAG(PE, BIT0))
{
GPIO_CLR_INT_FLAG(PE, BIT0);
if(PE0 == 0)
keyState |= 1 << 7;
else if(PE0 == 1)
keyState &= ~(1 << 7);
}
KeyDev.Input.data1.value = keyState;
if(KeyDev.Input.data1.value > 0)
{
PA2 = 0;
}
else
{
PA2 = 1;
}
}