本帖最后由 hclwj181 于 2020-5-17 17:25 编辑
void emwindemo_task(void *p_arg)
{
GUI_AUTODEV AutoDev;
GUI_AUTODEV_INFO AutoDevInfo;
PARAM aparam;
u32 taskcon=1;
u8 t = 0;
GUI_HWIN hp;
float angle1, angle2, angle3;
// Rotate rotate; //´Ë½á¹¹Ì彫×÷Ϊ²ÎÊý´«ÈëDrawItº¯ÊýÖÐ
GUI_SetBkColor(GUI_WHITE); //ÉèÖñ³¾°É«Îª°×É«
GUI_SetColor(GUI_BLACK); //ÉèÖÃÑÕɫΪºÚÉ«
GUI_Clear();
GUI_AA_EnableHiRes();
GUI_AA_SetFactor(4);
GUI_MEMDEV_CreateAuto(&AutoDev);
// BUTTON_CreateEx(250,120,20,30,hp,1,1,ID_BUTTON_0);
// BUTTON_CreateEx(250,170,20,30,hp,1,1,ID_BUTTON_1);
while(taskcon)
{
// if(getdatetime()) //´Ë´¦²ÉÓÃRTCÌṩʱ¼ä£¬Ã¿ÃëÖ´ÐÐÒ»´Î
{
t = calendar.sec;
angle1 = 2 * (60 - t) * 3.1415926 / 60; //ÃëÕëÐýת½Ç¶È£¬Ã¿ÃëÐýת6¶È
angle2 = 2 * (600 - calendar.min * 10 - t / 6) * 3.1415926 / 600;
if(calendar.hour >= 12)angle3 = 2 * (120 - (calendar.hour - 12) * 10 - calendar.min / 6) * 3.1415926 / 120;
else angle3 = 2 * (120 - calendar.hour * 10 - calendar.min / 6) * 3.1415926 / 120;
GUI_RotatePolygon(aparam.arotate.newPoints1, sPoints, 3, angle1);
GUI_RotatePolygon(aparam.arotate.newPoints2, mPoints, 3, angle2);
GUI_RotatePolygon(aparam.arotate.newPoints3, hPoints, 3, angle3);
GUI_MEMDEV_DrawAuto(&AutoDev, &aparam.AutoDevInfo, &DrawIt, &aparam);
sprintf((char *)dttmp,"%04d-%02d-%02d %02d:%02d:%02d\n",calendar.w_year,calendar.w_month,calendar.w_date,calendar.hour,calendar.min,calendar.sec);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_SetFont(&GUI_Font16B_ASCII);
GUI_DispStringAt(&dttmp[11],240,60);
dttmp[10]=0;
GUI_DispStringAt(dttmp,240,30);
}
//GUI_Delay(200);
GUI_Exec();
}
GUI_MEMDEV_DeleteAuto(&AutoDev);
很简单的一个程序 |