?? isr.c
字號:
/***************************************************************************** * ISR.c
* Frank.liux 2008-12-17 *****************************************************************************/
#include "..\include\AD7877.h"
#include "..\include\AD7877_Register.h"
#include "stdio.h"
char FLAG_DAV=0;
char FLAG_PENIRQ=0;
int X_Location,Y_Location,nano;
EX_INTERRUPT_HANDLER(IsrPB4_5)
{
int Pint0_State ;
// Pint0_State = *pPINT0_LATCH;
Pint0_State = *pPINT0_PINSTATE;
/* clear interrupt request */
*pPINT0_REQUEST = PIQ4|PIQ5;
*pPINT0_MASK_CLEAR = PIQ4|PIQ5;
if ((Pint0_State&PIQ4) == PIQ4)
{
// char iData=0;
X_Location = AD7877_Read();
Y_Location = AD7877_Read();
/*
for (iData<14;iData++;)
{
nano = AD7877_Read();
}
*/
/* next read register should be reprogrammed start at X+ Register ,or DSP would read a Series
registers that are empty
Notic: In master mode ,when you touch the screen,the result you recived was the
previous convert result */
AD7877_Program (AD7877_CONTROL_REG1,
AD7877_MODE_3+
X
);
/*The abs(); function returns the absolute value of its integer input*/
printf("The X :%d\n",abs(X_Location/8.5));
printf("The Y :%d\n",abs(Y_Location/15));
printf("######################\n");
}
if ((Pint0_State&PIQ5) == PIQ5)
{
}
/* start interrupt again */
*pPINT0_MASK_SET = PIQ4|PIQ5;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -