小弟最近在学习F407时,用它来点亮一块8寸的TFT液晶,在调试发现程序会一直卡死在WAIT_SYNC这句话;程序大致如下:
#define LCD_SYNC_PORT GPIOG
#define LCD_SYNC_BIT GPIO_Pin_2
#define LCD_SYNC_STATE GPIO_ReadInputDataBit(LCD_SYNC_PORT, LCD_SYNC_BIT)
//sync下降沿同步
#define WAIT_SYNC {while(!LCD_SYNC_STATE);
while(LCD_SYNC_STATE);}
//LCD_SYNC_IN;  
G2
GPIO_InitStructure.GPIO_Pin = LCD_SYNC_BIT;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; //浮空输入
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_Init(LCD_SYNC_PORT, &GPIO_InitStructure);
LCD初始函数中:
求大神解救。。。。拜托
一周热门 更多>