void MainTask(void) {
  int XSize, YSize;
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  GUI_Init();
  XSize = LCD_GetXSize();
  YSize = LCD_GetYSize();
  GUI_DrawBitmap(&bmLogoBitmap, (XSize - bmLogoBitmap.XSize) / 2, (YSize - bmLogoBitmap.YSize) / 3);
  GUI_SetFont(&GUI_Font24B_ASCII);
  GUI_DispStringHCenterAt("www.segger.com", XSize / 2, (YSize - bmLogoBitmap.YSize) / 3 + bmLogoBitmap.YSize + 10);
  GUI_Delay(1000);
  WM_SetDesktopColor(GUI_BLACK); /* Not required since desktop is not visible */
  GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
}
示例#2
0
void MainTask(void) {
  WM_HWIN hWin;

  GUI_Init();
  GUI_CURSOR_Show();
  WM_SetCreateFlags(WM_CF_MEMDEV);
  WM_EnableMemdev(WM_HBKWIN);
  WM_SetCallback(WM_HBKWIN, &_cbBkWindow);
  while (1) {
    hWin = GUI_CreateDialogBox(_aDialogOrder, GUI_COUNTOF(_aDialogOrder), &_cbDialogOrder, WM_HBKWIN, 0, 0); 
    WM_MakeModal(hWin);
    GUI_ExecCreatedDialog(hWin);
    GUI_Delay(1500);
  }
}
示例#3
0
/*********************************************************************
*
*          MainTask
*/
void MainTask(void) {
  int Index;

  GUI_Init();
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  WM_SetDesktopColor(GUI_BLACK);
  //
  // Initialize the temperature arrays
  //
  _InitRandomData(_aTemp1, GUI_COUNTOF(_aTemp1));
  _InitRandomData(_aTemp2, GUI_COUNTOF(_aTemp2));
  //
  // Execute the intro dialog
  //
  GUI_ExecDialogBox(_aDialogIntro, GUI_COUNTOF(_aDialogIntro), _cbDialogIntro, WM_HBKWIN, 0, 0);
  //
  // Execute the color and the temperature dialog
  //
  _hDialogColor = GUI_CreateDialogBox(_aDialogColor, GUI_COUNTOF(_aDialogColor), _cbDialogColor, WM_HBKWIN, 0, 0);
  _hDialogMain  = GUI_CreateDialogBox(_aDialogMain,  GUI_COUNTOF(_aDialogMain),  _cbDialogMain,  WM_HBKWIN, 0, 0);
  //
  // Add new temperatures...
  //
  Index = GUI_COUNTOF(_aTemp1) - 1;
  while (1) {
    WM_HWIN hItem;
    GUI_Delay(100); // Wait a while
    //
    // Shift the color arrays
    //
    memmove(_aTemp1, _aTemp1 + 1, sizeof(_aTemp1) - 2);
    memmove(_aTemp2, _aTemp2 + 1, sizeof(_aTemp2) - 2);
    //
    // Add new values
    //
    _aTemp1[Index] = _GetRandomValue(_aTemp1[Index - 1]);
    _aTemp2[Index] = _GetRandomValue(_aTemp2[Index - 1]);
    //
    // Update windows
    //
    hItem = WM_GetClientWindow(WM_GetDialogItem(_hDialogMain, ID_TEMPERATURE));
    WM_InvalidateWindow(hItem);
    _SetProgbarValue(GUI_ID_PROGBAR0, _aTemp1[Index]);
    _SetProgbarValue(GUI_ID_PROGBAR1, _aTemp2[Index]);
  }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);
  WM_SetCreateFlags(WM_CF_MEMDEV);  // Use memory devices on all windows to avoid flicker
  while (1) {
    GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbCallback, 0, 0, 0);
    GUI_Delay(1000);
  }
}
示例#5
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Use memory devices for all windows
  //
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
    WM_EnableMemdev(WM_HBKWIN);
  #endif
  WM_SetDesktopColor(GUI_GREEN);
  while(1) {
    _Font = _Color = 0;
    GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbDialog, 0, 0, 0);
    GUI_Delay(1000);
  }
}
示例#6
0
/*********************************************************************
*
*       MainTask
*
**********************************************************************
*/
void LimitSpeedT(WM_MESSAGE * pMsg)
{ 

	current_interface = PORTABLE_LIMIT_SPEED_T;
	if(pMsg)
	{
		WM_DeleteWindow(pMsg->hWin);
		flag_paint = 0;
	}

   WM_SetDesktopColor(GUI_BLACK);      /* Automacally update desktop window */
   WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */

   current_handle = GUI_CreateDialogBox(_aDialogCreate_LimT, GUI_COUNTOF(_aDialogCreate_LimT), &_cbCallback_LimT, 0, 0, 0);

}
示例#7
0
void Task3(void *Tags)
{	
	uint8 *P_SIFA,*P_SIFB;
	uint32 Length;
	WM_HWIN hWin;
	
	WM_SetCreateFlags(WM_CF_MEMDEV);
	hWin=CreateLogin();
	Login_SetProgbar(hWin,0);
	Login_SetText(hWin,"Load Font...");
	P_SIFA=LoadFile_ToRAM("songti16.sif");
	if(P_SIFA==0){Login_SetText(hWin,"Load Font Fail!");GUI_Delay(10000);}
	Login_SetProgbar(hWin,50);
	P_SIFB=LoadFile_ToRAM("songti12.sif");
	if(P_SIFB==0){Login_SetText(hWin,"Load Font Fail!");GUI_Delay(10000);}
	Login_SetProgbar(hWin,100);
	GUI_SIF_CreateFont((void*)P_SIFA, &SIFA_Font, GUI_SIF_TYPE_PROP);
	GUI_SIF_CreateFont((void*)P_SIFB, &SIFB_Font, GUI_SIF_TYPE_PROP);
	GUI_EndDialog(hWin,0);
	
	CreateWindow();
	GUI_CURSOR_Show();
	while(1)
	{
//			hItem=WM_GetDialogItem(hWin, ID_PROGBAR_0);
//			PROGBAR_SetValue(hItem, Tos_CPUInfor.Userate_CPU);
//		  hItem=WM_GetDialogItem(hWin, ID_EDIT_0);
//			GetStringByFmt(&Buf[0],"%d",adc_value);
//			EDIT_SetText(hItem, &Buf[0]);
//			// CreateMywindow();
//	GUI_Exec();
////		GUI_AA_SetFactor(3);
////		GUI_SetColor(GUI_BLACK);
////		GUI_AA_FillRoundedRect(10,10,54,54,5);
////		Tos_TaskDelay(1000);
////		GUI_SetColor(GUI_WHITE);
////		GUI_AA_FillRoundedRect(10,10,54,54,5);
////		GUI_AA_FillRoundedRect(100,100,154,154,5);
////		GUI_AA_DrawLine(50,50,70,70);
////		GUI_AA_DrawLine(70,50,50,70);
////		GUI_DispDecAt(i++,20,20,4);
//				P_SIFA=LoadFile_ToRAM("c.gif");
//	GUI_GIF_Draw(P_SIFA,RMema_Length(P_SIFA),0,0);
		GUI_Delay(10);
		//GUI_SendKeyMsg('a',1);
	}
}
示例#8
0
文件: GUIDEMO.c 项目: Mrho/ucos-gui
/*********************************************************************
*
*       GUIDEMO_main(): Small version of the demo
*
**********************************************************************
*/
void GUIDEMO_main(void) {
  #if GUI_WINSUPPORT
    int i;
  #endif
  #if GUI_WINSUPPORT
    #if LCD_NUM_DISPLAYS > 1
      FRAMEWIN_CreateAsChild(10, 10, 100, 100, WM_GetDesktopWindowEx(1), "Display 1", NULL, WM_CF_SHOW);
      GUI_Delay(1000);
    #endif
    WM_SetCreateFlags(WM_CF_MEMDEV);  /* Automatically use memory devices on all windows */
    _ButtonSizeX = 27;
    _ButtonSizeY = 14;
    _ahButton[0] = BUTTON_Create(LCD_GetXSize() - _ButtonSizeX * 2 - 5,
                                 LCD_GetYSize() - _ButtonSizeY - 3,
                                 _ButtonSizeX, _ButtonSizeY, 
                                 'H' , WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV);
    _ahButton[1] = BUTTON_Create(LCD_GetXSize() - _ButtonSizeX - 3,
                                 LCD_GetYSize() - _ButtonSizeY - 3,
                                 _ButtonSizeX, _ButtonSizeY, 
                                 'N' , WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV);
    BUTTON_SetFont(_ahButton[0], &GUI_Font8_ASCII);
    BUTTON_SetFont(_ahButton[1], &GUI_Font8_ASCII);
    BUTTON_SetText(_ahButton[0], "Stop");
    BUTTON_SetText(_ahButton[1], "Next");
    _UpdateCmdWin();
    WM_ExecIdle();
  #endif
  /* Show Intro */
  GUIDEMO_Intro();
  /* Run the individual demos !  */
  for (_iTest = 0; _apfTest[_iTest]; _iTest++) {
    GUI_CONTEXT ContextOld;
    GUI_SaveContext(&ContextOld);
    _iTestMinor = 0;
    _UpdateCmdWin();
    (*_apfTest[_iTest])();
    _CmdNext = 0;
    GUI_RestoreContext(&ContextOld);
  }
  /* Cleanup */
  #if GUI_WINSUPPORT
    for (i = 0; i < countof(_ahButton); i++) {
      BUTTON_Delete(_ahButton[i]);
    }
  #endif
}
void rt_gui_thread_entry(void* parameter) 
{
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
  /*设置默认创建标记WM 然后会将 WM_PAINT 消息输出重定向到存储设备中,再复制到显
  示器中。如果整个窗口的内存不够,会自动使用分段*/
  WM_SetCreateFlags(WM_CF_MEMDEV);
  touch_config();
  Timer5Config();
  GUI_Init();
  GUI_Initialized = 1;
  ADC_Config();
  LED_Init();
  RS485GPIOConfig();
  RS485Write();
  
  GUIDEMO_Main();

}
示例#10
0
/*********************************************************************
*
*       MainTask
*
**********************************************************************
*/
void home(WM_MESSAGE * pMsg) 
{ 
	current_interface = HOME; 

	if(pMsg)
	{
	WM_DeleteWindow(pMsg->hWin);
#if 0
	WM_HideWindow(pMsg->hWin);
#endif 
	}
    WM_SetDesktopColor(GUI_WHITE);      /* Automacally update desktop window */
    WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */

    current_handle = GUI_CreateDialogBox(_aDialogCreate_Home, GUI_COUNTOF(_aDialogCreate_Home), &_cbCallback_Home, 0, 0, 0);

	h_home = current_handle;
}
示例#11
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  WM_SetCallback(WM_HBKWIN, &_cbBkWindow);
  //
  // Create message box and wait until it is closed
  //
  while (1) {
    GUI_MessageBox("This text is shown\nin a message box",
                   "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE);
    GUI_Delay(750);                    // Wait for a short moment ...
    GUI_MessageBox("New message !",
                   "Caption/Title", GUI_MESSAGEBOX_CF_MOVEABLE);
    GUI_Delay(750);
  }
}
示例#12
0
int main(void)
{
	InitHard();

	// Init the STemWin GUI Library.
	GUI_Init();
	GUI_Initialized = 1;

	// Activate the use of memory device feature.
	WM_SetCreateFlags(WM_CF_MEMDEV);

	WM_HWIN hDlg = CreateTestDlg();

	while (1)
	{
		GUI_Delay(10);
	}
}
示例#13
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  int Value = 0;
  WM_HWIN hDlgFrame;
  GUI_Init();
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);  
  WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */
  while(1) {
    WM_HWIN hDlg, hText;
    char acText[3] = {0};
    GUI_Delay(150);
    if (!WM_IsWindow(hDlgFrame)) {
      hDlgFrame = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
    }
    Value = (Value + 1) % 100;
    acText[0] = '0' + Value / 10;
    acText[1] = '0' + Value % 10;
    hDlg = WM_GetClientWindow(hDlgFrame);
    hText = WM_GetDialogItem(hDlg, GUI_ID_TEXT0);
    TEXT_SetText(hText, acText);
  }
}
void MainTask(void) {
  WM_HWIN hItem, hDlg;

  GUI_Init();
  #if GUI_SUPPORT_CURSOR
    GUI_CURSOR_Show();
  #endif
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  hDlg = GUI_CreateDialogBox(_aMain, GUI_COUNTOF(_aMain), &_cbMain, 0, 0, 0);
  hItem = WM_GetDialogItem(hDlg, GUI_ID_TREEVIEW0);
  if (hItem == 0) {
    WM_DeleteWindow(hDlg);
  } else {
    WM_SetFocus(hItem);
    while (1) {
      GUI_Delay(100);
    }
  }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  GUI_CURSOR_Show();
  WM_SetCallback(WM_HBKWIN, _cbBkWin);
  while(1) {
    _DemoMultiedit();
    *_acInfoText = 0;
    WM_InvalidateWindow(WM_HBKWIN);
    GUI_Delay(SPEED);
  }
}
void MainTask(void) {
  WM_HWIN hWin;

  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  GUI_CURSOR_Show();
  WM_SetCreateFlags(WM_CF_MEMDEV);
  WM_EnableMemdev(WM_HBKWIN);
  WM_SetCallback(WM_HBKWIN, &_cbBkWindow);
  while (1) {
    hWin = GUI_CreateDialogBox(_aDialogOrder, GUI_COUNTOF(_aDialogOrder), &_cbDialogOrder, WM_HBKWIN, 0, 0); 
    WM_MakeModal(hWin);
    GUI_ExecCreatedDialog(hWin);
    GUI_Delay(1500);
  }
}
示例#17
0
文件: Task_0.c 项目: dadianxukong/gps
/*********************************************************************
*
*       Task_0
*/
void Task_0(void) {
    WM_HWIN hWin = 0;
    _Auto = 1;
    GUI_SelectLayer(LAYER);
    WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */
    WM_EnableMemdev(WM_HBKWIN);
    WM_SetCallback(WM_HBKWIN, _cbBkWindow);
    GUI_Exec();
    GUI_CURSOR_ShowEx(LAYER);
    hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
    while (1) {
        if (_Auto) {
            _PlayNextEvent(hWin);
        } else {
            SIM_Delay(100);
        }
        if (WM_IsWindow(hWin) == 0) {
            SIM_Delay(1000);
            hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, WM_GetDesktopWindowEx(LAYER), 0, 0);
        }
    }
}
示例#18
0
/*********************************************************************
*
*       MainTask
*
**********************************************************************
*/
void LimitSpeedH(WM_MESSAGE * pMsg)
{ 
	WM_HWIN hGraph = 0;
	if(pMsg)
	{
		WM_DeleteWindow(pMsg->hWin);
	}
    WM_SetDesktopColor(GUI_WHITE);      /* Automacally update desktop window */
    WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */
    //PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
    //FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
    //PROGBAR_SetDefaultSkin(PROGBAR_SKIN_FLEX);
    //BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
    //CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
    //DROPDOWN_SetDefaultSkin(DROPDOWN_SKIN_FLEX);
    //SCROLLBAR_SetDefaultSkin(SCROLLBAR_SKIN_FLEX);
    //SLIDER_SetDefaultSkin(SLIDER_SKIN_FLEX);
    //HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
    //RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
    current_handle = GUI_CreateDialogBox(_aDialogCreate_Lim, GUI_COUNTOF(_aDialogCreate_Lim), &_cbCallback_Lim, 0, 0, 0);
	current_interface = PORTABLE_LIMIT_SPEED;

}
void MainTask(void) {
  //
  // Init GUI
  //
  WM_SetCreateFlags(WM_CF_MEMDEV);
  GUI_Init();
  #if GUI_SUPPORT_CURSOR
    GUI_CURSOR_Hide();  // Hide cursor before first page is shown
  #endif
  //
  // Show SEGGER logo
  //
  GUI_Clear();
  GUI_SetColor(GUI_WHITE);
  GUI_FillRect(0, 0, LCD_GetXSize(), LCD_GetYSize());
  GUI_DrawBitmap(&bmIMAGE_SeggerLogo_300x150_565c, (LCD_GetXSize() - 300) / 2, (LCD_GetYSize() - 150) / 2);
  GUI_X_Delay(SEGGERDEMO_DELAY);
  GUI_Clear();
  //
  // Start GUIDEMO samples, GUIDEMO_Main is an endless loop itself. Therefor we can start it as task directly.
  //
  GUIDEMO_Main();
}
示例#20
0
void MainTask(void) {
  GUI_Init();
  GUI_SetBkColor(GUI_BLACK);
  WM_SetCreateFlags(WM_CF_MEMDEV);
  WM_EnableMemdev(WM_HBKWIN);
  while (1) {
    _DemoSetDesktopColor();
    _DemoCreateWindow();
    _DemoCreateWindowAsChild();
    _DemoInvalidateWindow();
    _DemoBringToTop();
    _DemoMoveTo();
    _DemoBringToBottom();
    _DemoMoveWindow();
    _DemoHideShowParent();
    _DemoHideShowChild();
    _DemoClipping();
    _DemoRedrawing();
    _DemoResizeWindow();
    _DemoSetCallback();
    _DemoDeleteWindow();
  }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  #if GUI_SUPPORT_MEMDEV
    WM_SetCreateFlags(WM_CF_MEMDEV);
  #endif
  FRAMEWIN_SetDefaultSkin(FRAMEWIN_SKIN_FLEX);
  BUTTON_SetDefaultSkin(BUTTON_SKIN_FLEX);
  RADIO_SetDefaultSkin(RADIO_SKIN_FLEX);
  CHECKBOX_SetDefaultSkin(CHECKBOX_SKIN_FLEX);
  HEADER_SetDefaultSkin(HEADER_SKIN_FLEX);
  GUI_CURSOR_Show();
  WM_SetCallback(WM_HBKWIN, _cbBkWin);
  while (1) {
    GUI_ExecDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, 0, 0, 0);
    GUI_Delay(1000);
  }
}
示例#22
0
portTASK_FUNCTION(vLcdTaskOpenDay, pvParameters)
{

	lcdInit( (uint32_t)&_aVRAM[0]);
	GUI_Init();
	WM_SetDesktopColor(GUI_GREEN);
	WM_SetCreateFlags(WM_CF_MEMDEV);
	char messaggio[50],msgg[3][70];
	statoDisplay=1;
	while ( 1 ) {
		while( xSemaphoreTake(xSemaDataAvail, portMAX_DELAY ) != pdTRUE );

		if (fIntervalReached==1) {
			GUI_ClearRect(0,214,317,249);
			showTime();
			fIntervalReached=0;
		}

//CALCOLA STATO DISPLAY SITUAZIONE NORMALE
		if (!fAlarmTimeMatched) {
			Nodo_t *temp1 = lista;
			Nodo_t *temp2 = listaScheduled;
			int j=0;
			statoDisplay=1;
			while (temp2!=NULL) {
				if(confronta_tag(temp1->info,temp2->info)==1) {
					temp1=lista;
					temp2=temp2->prox;
				} else {
					if (temp1->prox!=NULL) {
						temp1=temp1->prox;
					} else {
						//temp2 non è presente nella scatola
							statoDisplay=2;
							int k=0,c=0;
							for (k=0; k<maxR; k++) {
								uint8_t tempTag[4];
								for (c=0;c<4;c++){
									tempTag[c] = l_tabellaMedicine[k][c];
								}
								if (confronta_tag(temp2->info,tempTag)==1) {
									for (c=0;c<35;c++){
										msgg[j][c] = l_tabellaMedicine[k][c+4];
									}
									j++;

									temp1=lista;
									temp2=temp2->prox;
								}
							}
					}//FINE else //temp2 non è presente nella scatola
				}
			}

			if (statoDisplay==1) {
				if (statoDisplayP!=1){
					GUI_Clear();
				}
				GUI_DispStringAt( "Nessuna medicina", 120-7*10/2, 50);
				GUI_DispStringAt( "da assumere", 120-7*10/2, 100);
			showTime();
			}

			if (statoDisplay==2) {
				if (statoDisplayP!=2){
					GUI_Clear();
				}
				GUI_Clear();
				int c=0;
				GUI_DispStringAt( "Nella scatola manca:", 80, 20);
				for (c=0;c<j;c++){
					GUI_DispStringAt( msgg[c], 80, 20*c+40);
				}
				showTime();
			}
			statoDisplayP=statoDisplay;
			vTaskDelay(300);
		}//FINE if !fAlarmTimeMatched
		else { //fAlarmTimeMatched
			showTimeAlarm(bUidPresent,nCardDetected,nCardPrevious);



			if ((nCardDetected<nCardPrevious) /*&& (tag)*/) {
				//GUI_Clear();
				if (tagRimosso[0] == ptrMedic->tag[0] && tagRimosso[1] == ptrMedic->tag[1] && tagRimosso[2] == ptrMedic->tag[2] && tagRimosso[3] == ptrMedic->tag[3] ){ //tag corretto
					GUI_SetColor(GUI_GREEN);
					GUI_Clear();
					sprintf( messaggio, "Medicina Corretta!");
					GUI_DispStringAt( messaggio, 40, 100);
					vTaskDelay(5000);
					if (nCardDetected<nCardTot) {
						GUI_DispStringAt( "Riposiziona la medicina", 0, 100);
						vTaskDelay(1000);
					}
					fAlarmTimeMatched=0;
					modifica=1;
					//MODIFICARE DOSI RIMANENTI
					int cc = 0;
					for (cc=0; cc<maxR; cc++) {
						if ((ptrMedic->tag[1] == l_tabellaMedicine[cc][1]) && (ptrMedic->tag[2] == l_tabellaMedicine[cc][2]) && (ptrMedic->tag[3] == l_tabellaMedicine[cc][3]) && (ptrMedic->tag[4] == l_tabellaMedicine[cc][4])) {
							uint8_t dose = l_tabellaMedicine[cc][55], rimasteInt = l_tabellaMedicine[cc][62], rimasteFraz = l_tabellaMedicine[cc][63];
							uint16_t rimaste = (rimasteInt << 2) | rimasteFraz; //0b11
							rimaste = rimaste-(uint16_t)dose; //SOLO QUANDO LA ASSUMO!
							uint8_t temp = rimaste;
							temp = temp&0b00000011;
							rimasteFraz = temp ;
							rimaste >>= 2;
							rimasteInt = (uint8_t) rimaste;

							l_tabellaMedicine[cc][62] = rimasteInt;
							l_tabellaMedicine[cc][63] = rimasteFraz;
						}

					}
					ptrMedic = ptrMedic->next;

					IP_RTC_TIME_T oraAllarme;
					oraAllarme.time[RTC_TIMETYPE_HOUR]  = ptrMedic->oraA;
					oraAllarme.time[RTC_TIMETYPE_MINUTE]  = ptrMedic->minA;
					oraAllarme.time[RTC_TIMETYPE_SECOND]  = ptrMedic->secA;

					if (orarioDopoOrario(FullTime,oraAllarme)) {
						fAlarmTimeMatched = 1;
					}
					else{
						FullTime.time[RTC_TIMETYPE_HOUR] = oraAllarme.time[RTC_TIMETYPE_HOUR];
						FullTime.time[RTC_TIMETYPE_MINUTE] = oraAllarme.time[RTC_TIMETYPE_MINUTE];
						FullTime.time[RTC_TIMETYPE_SECOND] = oraAllarme.time[RTC_TIMETYPE_SECOND];
						Chip_RTC_SetFullAlarmTime(&FullTime);
					}

				} else{
					//mostra che hai tolto il tag ERRATO!
					GUI_SetColor(GUI_RED);
					GUI_Clear();
					sprintf( messaggio, "Medicina ERRATA!");
					GUI_DispStringAt( messaggio, 40, 100);
					showTimeAlarm(bUidPresent, nCardDetected, nCardPrevious);
					vTaskDelay(2000);
					modifica=1;
				}
			}
示例#23
0
void MainTask(void) {
    WM_SetCreateFlags(WM_CF_MEMDEV);
    GUI_Init();
    WM_MULTIBUF_Enable(1);
    GUIDEMO_Main();
}
示例#24
0
/*********************************************************************
*
*       emWin
*
* Function description:
*   emWin demo application
*
*/
void emWin(const T_choice *aChoice) {


  T_uezDevice    hLCD;
  U32            FrameBufferSize;
  T_uezTask      hTouchTask;

	(void)aChoice;
  FrameBufferSize = UEZ_LCD_DISPLAY_WIDTH * UEZ_LCD_DISPLAY_HEIGHT * GUI_NUM_VIRTUAL_DISPLAYS * GUI_PIXEL_WIDTH;
    GUI_pMem    = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize);
  GUI_MemSize =       (GUI_VRAM_SIZE      - FrameBufferSize);
  memset((void*)GUI_VRAM_BASE_ADDR, 0, GUI_MemSize);//FrameBufferSize);
  //
  // Check that frame buffer memory fits into VRAM memory and we have empty memory left
  //
  if (GUI_VRAM_SIZE <= FrameBufferSize) {
    return;  // Error, not enough memory
  }
  //
  // Assign memory left to emWin memory
  //
  //GUI_pMem    = (U32*)(GUI_VRAM_BASE_ADDR + FrameBufferSize);
  //GUI_MemSize =       (GUI_VRAM_SIZE      - FrameBufferSize);
  //
  // emWin startup
  //
#if EMWIN_LOAD_ONCE
  if(G_emWinLoaded == EFalse)
  {
  WM_SetCreateFlags(WM_CF_MEMDEV);  // Enable memory devices
  

	  GUI_Init();
	  G_emWinLoaded = ETrue;
  }
#else
  WM_SetCreateFlags(WM_CF_MEMDEV);  // Enable memory devices
  GUI_Init();
#endif
  //
  // Open the LCD
  //
  if (UEZLCDOpen("LCD", &hLCD) == UEZ_ERROR_NONE)  {

    //
    // Create touch screen queue
    //
    if (UEZQueueCreate(1, sizeof(T_uezInputEvent), &_hTSQueue) == UEZ_ERROR_NONE) {
      //
      // Open touch screen
      //
      if (UEZTSOpen("Touchscreen", &_hTouchScreen, &_hTSQueue) == UEZ_ERROR_NONE) {
        //
        // Create touch task
        //
        if (UEZTaskCreate((T_uezTaskFunction)_TouchTask, "TouchTask",  1024, 0, UEZ_PRIORITY_VERY_HIGH, &hTouchTask) == UEZ_ERROR_NONE) {

          //
          // emWin application
          //
          GUIDEMO_Main();

          _RequestExit = 1;
          while (_RequestExit == 1) {
            UEZTaskDelay(1);  // Wait for touch task to terminate
          }
        }
        //
        // Close touch screen
        //
        UEZTSClose(_hTouchScreen, _hTSQueue);
      }
      UEZQueueDelete(_hTSQueue);
    }
    //
    // Close the LCD
    //
    UEZLCDClose(hLCD);
  }
  //
  // emWin cleanup
  //
#if !EMWIN_LOAD_ONCE
  GUI_Exit();
#endif
}
void GUIDEMO_main(void) {
  #if GUI_WINSUPPORT
    int i;
  #endif
  GUI_Clear();
  #if GUI_WINSUPPORT
    WM_SetCreateFlags(WM_CF_MEMDEV);  /* Automatically use memory devices on all windows */
    /* Calculate position and size of FrameWin[1] */
    _FrameWinSizeX[1] = 80;
    _FrameWinSizeY[1] = 60;
    _FrameWinPosX[1] = LCD_GetXSize() - _FrameWinSizeX[1];
    _FrameWinPosY[1] = LCD_GetYSize() - _FrameWinSizeY[1];
    _ButtonSizeX = (_FrameWinSizeX[1] - 20) / 2;
    _ButtonSizeY = 20;
    /* Create the control window incl. buttons */
    _ahFrameWin[1] = FRAMEWIN_Create("Control", NULL, WM_CF_SHOW | WM_CF_STAYONTOP,
                                     _FrameWinPosX[1], _FrameWinPosY[1],
                                     _FrameWinSizeX[1], _FrameWinSizeY[1]);
    _ahInfoWin[1] = WM_CreateWindowAsChild(0, 0, 0, 0, _ahFrameWin[1], 
                                           WM_CF_SHOW | WM_CF_STAYONTOP, 0, 0);
    _ahButton[0] = BUTTON_CreateAsChild(_FrameWinSizeX[1] / 20,
                                 + 20, _ButtonSizeX, _ButtonSizeY, _ahFrameWin[1], 
                                 'H' , WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV);
    _ahButton[1] = BUTTON_CreateAsChild(_FrameWinSizeX[1] / 2,
                                 + 20, _ButtonSizeX, _ButtonSizeY, _ahFrameWin[1], 
                                 'N' , WM_CF_SHOW | WM_CF_STAYONTOP | WM_CF_MEMDEV);
    BUTTON_SetText(_ahButton[0], "Stop");
    BUTTON_SetText(_ahButton[1], "Next");
    _UpdateCmdWin();
    WM_ExecIdle();
  #endif
  /* Show Intro */
  GUIDEMO_Intro();
  #if GUI_WINSUPPORT
    /* Calculate position and size of FrameWin[0] */
    _FrameWinSizeX[0] = LCD_GetXSize() / 2;
    _FrameWinSizeY[0] = 65;
    _FrameWinPosX[0] = LCD_GetXSize() - _FrameWinSizeX[0];
    _FrameWinPosY[0] = 0;
    /* Create info window and run the individual demos */
    _ahFrameWin[0] = FRAMEWIN_Create("ARMSYS Demo", NULL, WM_CF_STAYONTOP, 
                                     _FrameWinPosX[0], _FrameWinPosY[0], _FrameWinSizeX[0], _FrameWinSizeY[0]);
    _ahInfoWin[0] = WM_CreateWindowAsChild(0, 0, 0, 0, _ahFrameWin[0], WM_CF_STAYONTOP, 0, 0);
    WM_ExecIdle();
  #endif
  /* Run the individual demos !  */
  for (_iTest = 0; _apfTest[_iTest]; _iTest++) {
    GUI_CONTEXT ContextOld;
    GUI_SaveContext(&ContextOld);
    _iTestMinor = 0;
    _UpdateCmdWin();
    (*_apfTest[_iTest])();
    _CmdNext = 0;
    GUI_RestoreContext(&ContextOld);
  }
  /* Cleanup */
  #if GUI_WINSUPPORT
    for (i = 0; i < countof(_ahFrameWin); i++) {
      WM_DeleteWindow(_ahFrameWin[i]);
    }
    for (i = 0; i < countof(_ahInfoWin); i++) {
      WM_DeleteWindow(_ahInfoWin[i]);
    }
  #endif
}
示例#26
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{  
  /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
     */
  HAL_Init();  
  
  /* Configure the system clock to 180 Mhz */
  SystemClock_Config();
  
  /* Initialize LCD and LEDs */
  BSP_Config();
  
  /***********************************************************/
  
  /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
  uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;
  
  /* Set TIMx instance */
  TimHandle.Instance = TIM3;
   
  /* Initialize TIM3 peripheral as follows:
       + Period = 500 - 1
       + Prescaler = ((SystemCoreClock/2)/10000) - 1
       + ClockDivision = 0
       + Counter direction = Up
  */
  TimHandle.Init.Period = 500 - 1;
  TimHandle.Init.Prescaler = uwPrescalerValue;
  TimHandle.Init.ClockDivision = 0;
  TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
  if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /*##-2- Start the TIM Base generation in interrupt mode ####################*/
  /* Start Channel1 */
  if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
  {
    while(1) 
    {
    }
  }
  
  /***********************************************************/

  
  /* Initialize RTC and Backup */
  RTC_Init();
  
  /* Init the STemWin GUI Library */
  GUI_Init();
  GUI_Initialized = 1;
  
  /* Activate the use of memory device feature */
  WM_SetCreateFlags(WM_CF_MEMDEV);

  /* Do the calibration if needed */
  CALIBRATION_Check();
  
  /* Start Demo */
  GUIDEMO_Main();
  
  /* Infinite loop */
  for(;;);
}
示例#27
0
void AppTaskGUI(void *p_arg)
{
//	uint8_t i;
	GUI_COLOR Colorsback;
	OS_ERR      err;
  OSTimeGet(&err);	
	(void) p_arg;
	
	RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);   // ¿ªÆôCRC ¹¦ÄÜ
	
	Lcd_Init();   // LCD ³õʼ»¯ 
	
  Touch_Init();  // ÏÔʾÆÁ³õʼ»¯ 
	
 	
  WM_SetCreateFlags(WM_CF_MEMDEV); // ¿ªÆô ´°¿Ú ÄÚ´æÔÊÐí
  GUI_Init();	    // £Ç£Õ£É¿ªÊ¼ 
	GUI_Clear();    // ÇåÆÁ 
	// FistPageDrawLine();
	// CPU_SR_ALLOC();
	// CPU_CRITICAL_ENTER(); // ½ûÖ¹ÖжÏ
	backWIn_init();  //µ÷ÓÃÏÔʾÆÁÏÔʾ½çÃæ
  Draw_init();
// 	GUI_CURSOR_Show();    //ÏÔʾָÕë 
   pageChangFlag=0;
	 while(1)
	 {
		 if(pageChangFlag)
		 {
			 
			 GUI_SelectLayer(1);
			 GUI_TOUCH_SetLayer(1);	
			 Colorsback=GUI_GetBkColor();
		   GUI_SetBkColor(GUI_DARKBLUE);
		   GUI_SetFont(GUI_FONT_8X16);	
			 GUI_DispStringAt("Station : ",10,10);				 
       GUI_DispDec(pageChangFlag,1);	
			 GUI_GotoXY(98,39);
			 GUI_DispFloat(getInformation[pageChangFlag-1].K_tmp,4);
			 GUI_GotoXY(98,58);
			 GUI_DispFloat(getInformation[pageChangFlag-1].K_hemo,4);
			 GUI_GotoXY(336,39);
			 GUI_DispFloat(getInformation[pageChangFlag-1].T_tmp,4);
			 GUI_GotoXY(336,58);
			 GUI_DispFloat(getInformation[pageChangFlag-1].T_hemp,4);
		   GUI_SetBkColor(Colorsback);
			 DrawingNewAnew(pageChangFlag);
	     COMAND=0x04;    // ÏÔʾҳÃæ 
	     DATA=1;	
			 GUI_Delay(100);
		 }else 
		 {
			 GUI_SelectLayer(0);
			 GUI_TOUCH_SetLayer(0);		
	     COMAND=0x04;    // ÏÔʾҳÃæ 
	     DATA=0;				 
			 showShuJu();
		 }
		 GUI_Delay(300);
	 }
}
示例#28
0
/**
* @brief  Main program
* @param  None
* @retval int
*/
int main(void)
{
  osTimerId lcd_timer;
  
    /* STM32F4xx HAL library initialization:
       - Configure the Flash prefetch, instruction and Data caches
       - Configure the Systick to generate an interrupt each 1 msec
       - Set NVIC Group Priority to 4
       - Global MSP (MCU Support Package) initialization
  */
  HAL_Init();
 
  /* Configure the system clock to 168 MHz */
  SystemClock_Config();
    
  /* Initialize Joystick, Touch screen and Leds */
  k_BspInit();
  k_LogInit();  
  
  /* Initializes backup domain */
  k_CalendarBkupInit();  
  
  /* Create GUI task */
  osThreadDef(GUI_Thread, GUIThread, osPriorityHigh, 0, 1024);
  osThreadCreate (osThread(GUI_Thread), NULL); 

  /*Initialize memory pools */
  k_MemInit();
  
  /* Add Modules*/
  k_ModuleInit();
  
  k_ModuleAdd(&video_player);
  k_ModuleOpenLink(&video_player, "emf");
  k_ModuleOpenLink(&video_player, "EMF");
  k_ModuleAdd(&image_browser);  
  k_ModuleOpenLink(&image_browser, "jpg"); 
  k_ModuleOpenLink(&image_browser, "JPG");
  k_ModuleOpenLink(&image_browser, "bmp"); 
  k_ModuleOpenLink(&image_browser, "BMP");
  k_ModuleAdd(&audio_player);  
  k_ModuleOpenLink(&audio_player, "wav"); 
  k_ModuleOpenLink(&audio_player, "WAV"); 
  k_ModuleAdd(&camera_capture);    
  k_ModuleAdd(&system_info);
  k_ModuleAdd(&file_browser);  
  k_ModuleAdd(&cpu_bench);  
  k_ModuleAdd(&game_board);  
  k_ModuleAdd(&usb_device);   
  
  /* Initialize GUI */
  GUI_Init();  

  /* Enable memory devices */
  WM_SetCreateFlags(WM_CF_MEMDEV);  
  
  /* Set General Graphical proprieties */
  k_SetGuiProfile();
  
  /* Create Touch screen Timer */
  osTimerDef(TS_Timer, TimerCallback);
  lcd_timer =  osTimerCreate(osTimer(TS_Timer), osTimerPeriodic, (void *)0);

  /* Start the TS Timer */
  osTimerStart(lcd_timer, 40);
  
  GUI_X_InitOS();
  
  /* Start scheduler */
  osKernelStart();

  /* We should never get here as control is now taken by the scheduler */
  for( ;; );
}
示例#29
0
void MainTask(void) {
  WM_SetCreateFlags(WM_CF_MEMDEV);
  GUI_Init();
  GUIDEMO_Main();
}
示例#30
0
/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
    /* STM32F4xx HAL library initialization:
         - Configure the Flash prefetch, instruction and Data caches
         - Configure the Systick to generate an interrupt each 1 msec
         - Set NVIC Group Priority to 4
         - Global MSP (MCU Support Package) initialization
       */
    HAL_Init();

    /* Configure the system clock to 180 MHz */
    SystemClock_Config();

    /* Initialize LCD and LEDs */
    BSP_Config();

    /***********************************************************/

    /* Compute the prescaler value to have TIM3 counter clock equal to 10 KHz */
    uwPrescalerValue = (uint32_t) ((SystemCoreClock /2) / 10000) - 1;

    /* Set TIMx instance */
    TimHandle.Instance = TIM3;

    /* Initialize TIM3 peripheral as follows:
         + Period = 500 - 1
         + Prescaler = ((SystemCoreClock/2)/10000) - 1
         + ClockDivision = 0
         + Counter direction = Up
    */
    TimHandle.Init.Period = 500 - 1;
    TimHandle.Init.Prescaler = uwPrescalerValue;
    TimHandle.Init.ClockDivision = 0;
    TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
    if(HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /*##-2- Start the TIM Base generation in interrupt mode ####################*/
    /* Start Channel1 */
    if(HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
    {
        while(1)
        {
        }
    }

    /***********************************************************/

    /* Init the STemWin GUI Library */
    BSP_SDRAM_Init(); /* Initializes the SDRAM device */
    __HAL_RCC_CRC_CLK_ENABLE(); /* Enable the CRC Module */

    GUI_Init();

    GUI_SetFont(&GUI_Font32_ASCII);

    GUI_DispStringAt("Starting...", 0, 0);

    /* Initialize LCD and LEDs */
    GUI_DispStringAt("Initializing lcd...", 0, 32);

    /* Activate the use of memory device feature */
    WM_SetCreateFlags(WM_CF_MEMDEV);

    MainTask();

    /* Infinite loop */
    for(;;);
}