int main(void)
{
u32 fontcnt;
u8 i,j;
u8 fontx[2];//gbkÂë
u8 key,t;
delay_init(); //Ñóê±oˉêy3õê¼»ˉ
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//éèÖÃÖD¶ÏóÅÏ輶·Ö×éÎa×é2£o2λÇàÕ¼óÅÏ輶£¬2λÏìó|óÅÏ輶
uart_init(115200); //′®¿ú3õê¼»ˉÎa115200
usmart_dev.init(72); //3õê¼»ˉUSMART
LED_Init(); //3õê¼»ˉóëLEDᬽóμÄó2¼t½ó¿ú
KEY_Init(); //3õê¼»ˉ°′¼ü
LCD_Init(); //3õê¼»ˉLCD
W25QXX_Init(); //3õê¼»ˉW25Q128
my_mem_init(SRAMIN); //3õê¼»ˉÄú2¿Äú′æ3Ø
exfuns_init(); //ÎafatfsÏà1رäá¿éêÇëÄú′æ
f_mount(fs[0],"0:",1); //1òÔØSD¿¨
f_mount(fs[1],"1:",1); //1òÔØFLASH.
while(font_init()) //¼ì2é×Ö¿a
{
UPD:
LCD_Clear(WHITE); //ÇåÆá
POINT_COLOR=RED; //éèÖÃ×ÖìåÎaoìé«
LCD_ShowString(30,50,200,16,16,"WarShip STM32");
while(SD_Init()) //¼ì2aSD¿¨
{
LCD_ShowString(30,70,200,16,16,"SD Card Failed!");
delay_ms(200);
LCD_Fill(30,70,200+30,70+16,WHITE);
delay_ms(200);
}
LCD_ShowString(30,70,200,16,16,"SD Card OK");
LCD_ShowString(30,90,200,16,16,"Font Updating...");
key=update_font(20,110,16,"0:");//¸üDÂ×Ö¿a
while(key)//¸üDÂ꧰ü
{
LCD_ShowString(30,110,200,16,16,"Font Update Failed!");
delay_ms(200);
LCD_Fill(20,110,200+20,110+16,WHITE);
delay_ms(200);
}
LCD_ShowString(30,110,200,16,16,"Font Update Success! ");
delay_ms(1500);
LCD_Clear(WHITE);//ÇåÆá
}
POINT_COLOR=RED;
Show_Str(30,50,200,16,"Õ½½¢STM32F103¿a·¢°å",16,0);
Show_Str(30,70,200,16,"GBK×Ö¿a2aêÔ3ìDò",16,0);
Show_Str(30,90,200,16,"ÕyμãÔ-×ó@ALIENTEK",16,0);
Show_Str(30,110,200,16,"2015Äê1ÔÂ20èÕ",16,0);
Show_Str(30,130,200,16,"°′KEY0,¸üDÂ×Ö¿a",16,0);
POINT_COLOR=BLUE;
Show_Str(30,150,200,16,"ÄúÂë¸ß×Ö½ú:",16,0);
Show_Str(30,170,200,16,"ÄúÂëμí×Ö½ú:",16,0);
Show_Str(30,190,200,16,"oo×Ö¼ÆêyÆ÷:",16,0);
Show_Str(30,220,200,24,"¶Ôó|oo×ÖÎa:",24,0);
Show_Str(30,244,200,16,"¶Ôó|oo×Ö(16*16)Îa:",16,0);
Show_Str(30,260,200,12,"¶Ôó|oo×Ö(12*12)Îa:",12,0);
while(1)
{
fontcnt=0;
for(i=0x81;i<0xff;i++)
{
fontx[0]=i;
LCD_ShowNum(118,150,i,3,16); //ÏÔê¾ÄúÂë¸ß×Ö½ú
for(j=0x40;j<0xfe;j++)
{
if(j==0x7f)continue;
fontcnt++;
LCD_ShowNum(118,170,j,3,16); //ÏÔê¾ÄúÂëμí×Ö½ú
LCD_ShowNum(118,190,fontcnt,5,16);//oo×Ö¼ÆêyÏÔê¾
fontx[1]=j;
Show_Font(30+132,220,fontx,24,0);
Show_Font(30+144,244,fontx,16,0);
Show_Font(30+108,260,fontx,12,0);
t=200;
while(t--)//Ñóê±,í¬ê±é¨Ãè°′¼ü
{
delay_ms(1);
key=KEY_Scan(0);
if(key==KEY0_PRES)goto UPD;
}
LED0=!LED0;
}
}
}
}
这是历程里面的源代码,烧写进去后,发现直接进入了while(font_init())循环,LCD上面显示“SD card OK” “Font Updating” “Font Updated Failed”,有没有大佬能给我解释下啊
一周热门 更多>