int main(void)
{
u8 x=0;
u8 t;
u16 times=0;
u8 lcd[12];
u8 len;
u8 lcd_id[12];
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
delay_init(168);
uart_init(115200);
LED_Init();
LCD_Init();
POINT_COLOR=RED;
sprintf((char*)lcd_id,"LCD ID:%04X",lcddev.id);
while(1)
{
if(USART_RX_STA&0x8000)
{
len=USART_RX_STA&0x3fff;
printf("\r\nÄú·¢ËíμÄÏûÏ¢Îa:\r\n");
for(t=0;t<len;t++)
{
USART_SendData(USART1, USART_RX_BUF[t]);
while(USART_GetFlagStatus(USART1,USART_FLAG_TC)!=SET);
}
printf("\r\n\r\n");
USART_RX_STA=0;
}
LCD_Clear(BROWN);
}
sprintf((char*)lcd,"LCD :%04X",USART_RX_BUF[t]);
POINT_COLOR=RED;
LCD_ShowString(30,40,210,24,24,"Explorer STM32F4");
LCD_ShowString(30,70,200,16,16,"TFTLCD TEST");
LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(30,110,200,16,16,lcd);
LCD_ShowString(30,130,200,12,12,"2014/5/4");
x++;
if(x==12)x=0;
LED0=!LED0;
delay_ms(1000);
}
}
|