新手上路
积分 31
金钱 31
注册时间 2018-7-21
在线时间 7 小时
1 金钱
大佬们,我用emwin写的用两个按键分别控制两个计时器,当按下一个按键的时候计时器开始显示数值,但当按下另外一个按键的时候前一个就停止了,只有当关闭后一个前一个才能继续运行,我用的GUI_Delay()这个函数来控制延时时间的,麻烦帮忙解决一下,都困扰差不多一周了 ,拜托了
case ID_BUTTON_13:
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
i = 0;
while(1){
hItem =WM_GetDialogItem(pMsg->hWin, ID_PROGBAR_3);
PROGBAR_SetFont(hItem, GUI_FONT_16_ASCII);
PROGBAR_SetSkin(hItem,PROGBAR_SKIN_FLEX);
PROGBAR_SetMinMax(hItem,0, 1000);
PROGBAR_SetValue(hItem,i);
i++;
if(i==1000)
i = 0;
Count[3]++;
hItem = WM_GetDialogItem(pMsg->hWin,ID_TEXT_31);
Second[3] = (Count[3] % 60);
sprintf(buf3,"%02d", Second[3]);
TEXT_SetText(hItem, (const char *)buf3);
hItem = WM_GetDialogItem(pMsg->hWin,ID_TEXT_32);
Minute[3] = Count[3] % 3600 / 60;
sprintf(buf3,"%02d", Minute[3]);
TEXT_SetText(hItem, (const char *)buf3);
hItem = WM_GetDialogItem(pMsg->hWin,ID_TEXT_33);
Hour[3] = Count[3] % (24 * 3600) / 3600;
sprintf(buf3,"%02d", Hour[3]);
TEXT_SetText(hItem, (const char *)buf3);
hItem = WM_GetDialogItem(pMsg->hWin,ID_TEXT_34);
Day[3] = Count[3] / (24 * 3600);
sprintf(buf3,"%02d", Day[3]);
TEXT_SetText(hItem, (const char *)buf3);
GUI_Delay(1000);
}
我来回答