GP21初始化后我的程序无法进入中断,不知道是什么原因,有没有谁用过GP21给点意见,谢谢
unsigned char GP2_Init(void)
{
int count = 0;
GP2_Write8(POR);//0x50
GP2_Write32(REG0, 0x10056801);
GP2_Write32(REG1, 0x21414001);
GP2_Write32(REG2, 0xE0000001);
GP2_Write32(REG3, 0x18000001);
GP2_Write32(REG4, 0x20000001);
GP2_Write32(REG5, 0x00000001);
GP2_Write32(REG6, 0xC0006001);
GP2_Write8(SCR);//0x03
while(1)
{
if(GP2_int==1)//进中断设标志位1
{
GP2_int = 0;
break;
}
delay_us(500);
count++;
if(count>=8)
{
count = 0;
return 0;
}
}
Calib_result = GP2_Read32(0xB0);
return 1;
} |