void systerm_init(void)
{
u16 i;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
delay_init(168);
uart_init(115200);
LED_Init();
LCD_Init();
BEEP_Init();
KEY_Init();
W25QXX_Init();
my_mem_init(SRAMIN);
tp_dev.init();
exfuns_init();
f_mount(fs[0],"0:",1);
LCD_Clear(BLACK);
BACK_COLOR=BLACK;
POINT_COLOR=WHITE;
while(SD_Init())
{
LCD_ShowString(10,40,200,800,24,"SD Card Error!");
delay_ms(500);
LED0=!LED0;
}
sd_ok=1;
LCD_ShowString(10,40,200,800,24,"SD Card OK!");
while(W25QXX_ReadID()!=W25Q128)
{
LCD_ShowString(10,70,200,800,24,"Ex Flash Error!!");
}
LCD_ShowString(10,70,200,800,24, "Ex Flash: KB");
LCD_ShowxNum(118,70,16*1024,5,24,0);
while(font_init())
{
LCD_ShowString(10,100,100,800,24, "Font Error!");
}
LCD_ShowString(10,100,100,800,24, "Font OK!");
// while(OV2640_Init())
// {
// LCD_ShowString(10,130,100,800,24, "OV2640 Error!");
// }
LCD_ShowString(10,130,200,800,24, "OV2640 OK!");
LCD_ShowString(10,170,200,800,24, "SYSTEM IS OK!!!");
while(GT9147_Scan(0) == 0)
{}
for(i=0;i<480;i++)
{
delay_ms(1);
LCD_Fast_DrawPoint(i,700,RED);
LCD_Fast_DrawPoint(i,701,RED);
LCD_Fast_DrawPoint(i,702,RED);
}
LCD_Clear(BLACK);
}
int main(void)
{
u8 res;
DIR picdir;
u8 *aname;
u8 mode;
systerm_init();
sw_sdcard_mode();
piclib_init();
res=f_opendir(&picdir,(const TCHAR*)"0:/CZ");
while(res==FR_OK)
{
aname="0:/CZ/BACK.jpg";
ai_load_picfile(aname,0,0,lcddev.width,lcddev.height,1);
POINT_COLOR=RED;
Show_Str(190,700,240,24,"»¶ó-ê1óÃ",24,1);
Show_Str(180,750,240,24,"ÎåÏßÆ×궱eòÇ",24,1);
break;
}
while(GT9147_Scan(0) == 0) //这个判断没有用
{}
OSInit();
OSTaskCreate(start_task,(void *)0,(OS_STK *)&START_TASK_STK[START_STK_SIZE-1],START_TASK_PRIO );//′′½¨Æeê¼èÎÎñ
OSStart();
}
程序如上
像红 {MOD}的地方标出来了,我系统初始化中间调用一次触屏,按一下在主函数中往下走,我又调用一次触屏,但是第二次的触屏判断没有用了,直接跳过了,后面还写了一个计算器,也是按一下出来好多数字,我之前还换一种方式直接读取gt9147的状态寄存器,也是一样的情况,求助是什么原因,万分感谢
一周热门 更多>