完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
#include "..incconfig.h" #define STACKSIZE 256 #define x_line 160 #define y_line 80 OS_STK_DATA stk; extern GUI_FONT GUI_Font8x16; OS_EVENT*Send_D7light_Sem; OS_EVENT*Send_LCD_Sem; OS_EVENT*Key_Mbox; I8 Hour[3],Min[3],Sec[3]; I8 hour = 15%12, min = 20, sec = 40; I8 YEA1[3],YEA2[3],MON[3],DAY[3]; int yea1 = 20,yea2=11, mon = 6, day = 23; int SpaceXS[61]={160,165,170,175,180,185, 189,193,197,201,205, 206,207,208,209,210, 209,208,207,206,205, 201,197,193,189,185, 180,175,170,165,160, 155,150,145,140,135, 131,127,123,119,115, 114,113,112,111,110, 111,112,113,114,115, 119,123,127,131,135, 140,145,150,155,160, }, SpaceYS[61]={30,31,32,33,34, 35,39,43,47,51, 55,60,65,70,75, 80,85,90,95,100, 105,109,113,117,121, 125,126,127,128,129, 130,129,128,127,126, 125,121,117,113,109, 105,100,95,90,85, 80,75,70,65,60, 55,51,47,43,39, 35,34,33,32,31,30}, SpaceXM[61]={160,164,168,172,176,180,183,186,189,192,195,196,197,198,199,200,199,198,197,196,195,192,189,186,183,180,176,172,168,164,160,156,152,148,144,140,137,134,131,128,125,124,123,122,121,120,121,122,123,124,125,128,131,134,137,140,144,148,152,156, 160 }, SpaceYM[61]={40,41,42,43,44,45,48,51,54,57, 60,64,68,72,76,80,84,88,92,96,100,103,106,109,112,115,116,117,118,119,120,119,118,117,116,115,112,109,106,103,100,96,92,88,84,80,76,72,68,64,60,57,54,51,48,45,44,43,42,41,4}, SpaceXH[13]={160,175,185,190,185,175,160,145,135,130,135,145,160}, SpaceYH[13]={50,55,65,80,95,105,110,105,95,80,65,55,50}, *Placex=&SpaceXS[40],*Placey=&SpaceYS[40],*Placexm=&SpaceXM[20],*Placeym=&SpaceYM[20], *Placexh=&SpaceXH[15%12],*Placeyh=&SpaceYH[15%12]; void show(I8 s) { if(s%5==0) { Set_Color(GUI_YELLOW); Set_Font(&GUI_Font8x16); Disp_String ("0862310104",10,30); Set_Font(&GUI_Font8x16); Disp_String ("0862310121",10,10);} else if(s%5==1) { Set_Color(GUI_YELLOW); Set_Font(&GUI_Font8x16); Disp_String ("guxin ",10,10); Set_Font(&GUI_Font8x16); Disp_String ("fanjuan ",10,30); } else if(s%5==2) { Set_Color(GUI_YELLOW); Set_Font(&GUI_Font8x16); Disp_String("0862310104",10,30); Set_Font(&GUI_Font8x16); Disp_String("0862310121",10,10); } else if(s%5==3) { Set_Color(GUI_YELLOW); Set_Font(&GUI_Font8x16); Disp_String ("fanjuan ",10,30); Set_Font(&GUI_Font8x16); Disp_String ("guxin ",10,10); } else if(s%5==4) { Set_Color(GUI_YELLOW); Set_Font(&GUI_Font8x16); Disp_String ("S3C44BOX ",10,10); Set_Font(&GUI_Font8x16); Disp_String ("LCD CLOCK ",10,30); } } void Shows() { show(sec); Set_Color(GUI_GRAY); //擦除上一秒 Draw_Line(x_line,y_line,*Placex,*Placey); Placex=Placex+1; Placey=Placey+1; Set_Color(GUI_YELLOW); //显示下一秒的 Draw_Line(x_line,y_line,*Placex,*Placey); Set_Color(GUI_RED); //显示下一分的 DrawLine(x_line,y_line,*Placexm,*Placeym); Set_Color(GUI_GREEN); //显示下一时的 Draw_Line(x_line,y_line,*Placexh,*Placeyh); if(Placex==&SpaceXS[60]&&Placey==&SpaceYS[60]) { Placex=&SpaceXS[0]; Placey=&SpaceYS[0]; } } void Showm() { Set_Color(GUI_GREEN); Set_Color(GUI_RED); Set_Color(GUI_YELLOW); Set_Color(GUI_GRAY); //擦除上一分的 DrawLine(x_line,y_line,*Placexm,*Placeym); Placexm=Placexm+1; Placeym=Placeym+1; Set_Color(GUI_RED); //显示下一分的 DrawLine(x_line,y_line,*Placexm,*Placeym);Set_Color(GUI_GREEN);//显示下一时的 Draw_Line(x_line,y_line,*Placexh,*Placeyh); if(Placexm==&SpaceXM[60]&&Placeym==&SpaceYM[60]) { Placexm=&SpaceXM[0]; Placeym=&SpaceYM[0]; } } void Showh() { Set_Color(GUI_YELLOW); Set_Color(GUI_GREEN); Set_Color(GUI_RED); Set_Color(GUI_GRAY); //擦除上一时的 DrawLine(x_line,y_line,*Placexh,*Placeyh); Placexh=Placexh+1; Placeyh=Placeyh+1; Set_Color(GUI_GREEN);//显示下一时的 DrawLine(x_line,y_line,*Placexh,*Placeyh); if(Placexh==&SpaceXH[12]&&Placeyh==&SpaceYH[12]) { Placexh=&SpaceXH[0]; Placeyh=&SpaceYH[0]; } } void Shouw_Cricle() // 整 点 { Set_Color(GUI_YELLOW); Fill_Circle (160, 30,2); // 12点(x,y,r) Fill_Circle (135, 35,2); // 11 点(x,y,r) Fill_Circle (115, 55,2); // 10 点(x,y,r) Fill_Circle (110, 80,2); // 9 点(x,y,r) Fill_Circle (115, 105,2); // 8 点(x,y,r) Fill_Circle (135, 125,2); // 7 点(x,y,r) Fill_Circle (160, 130,2); // 6 点(x,y,r) Fill_Circle (185, 125,2); // 5 点(x,y,r) Fill_Circle (205, 105,2); // 4 点(x,y,r) Fill_Circle (210, 80,2); // 3 点(x,y,r) Fill_Circle (205, 55,2); // 2点(x,y,r) Fill_Circle (185, 35,2); // 1点(x,y,r) } void Show_ht() { Set_Color(GUI_GRAY); Fill_Circle (160,80,54); } void ChangeForm(char time[],char time) { Time[0] = time / 10 + 48; Time[1] = time % 10 + 48; Time[2] = ' |