سلام دوستان
من emwin5.22 رو برد landtiger kavir اجرا میکنم بااجرای دستور giu_delay صفحه lcd سیاه میشه
این هم کدشه
کد:
GUI_TOUCH_SetDefaultCalibration();
/* _Calibrate upper left */ GUI_SetBkColor(GUI_RED);
GUI_Clear();
GUI_SetColor(GUI_WHITE); GUI_FillCircle(ax[0], ay[0], 10);
GUI_SetColor(GUI_RED); GUI_FillCircle(ax[0], ay[0], 5);
GUI_SetColor(GUI_WHITE);
GUI_DispStringAt("Press here", ax[0]+20, ay[0]);
do {
GUI_PID_STATE State;
GUI_TOUCH_GetState(&State);
if (State.Pressed) {
ax_Phys[0] = GUI_TOUCH_GetxPhys();
ay_Phys[0] = GUI_TOUCH_GetyPhys();
break;
}
GUI_Delay (10);
} while (1);
البته این کد برا uGUI بود که رو سی دی برد هست
و این هم کد MAIN TASK
کد:
#include <rtl.h>
#include "GUI.h"
#include "FRAMEWIN.h"
#include <stddef.h>
#include "lpc17xx.h"
#include "touchpanel.h"
#if GUI_OS == 0
#error Multitasking sample requires task awareness (#define GUI_OS 1)
#endif
/*******************************************************************
*
* Define how to create a task and start multitasking
*
********************************************************************
If not using embOS you have to change the hardware
dependent macros to work with your OS
*/
#ifndef WIN32
#include <RTL.h> /* Definitions for embOS */
// #define OS_CREATETASK(pTCB, pName, pFunc, Priority, pStack)
// #define CREATE_TASK(pTCB, pName, pFunc, Priority, pStack) OS_CREATETASK(pTCB, pName, pFunc, Priority, pStack)
// #define START_MT() OS_Terminate(0)
#define Delay(t) os_dly_wait(t)
#else
#include "SIM.h" /* Definitions for the Win32 simulation */
#define CREATE_TASK(pTCB, pName, pFunc, Priority, pStack) SIM_CreateTask(pName, pFunc)
#define START_MT() SIM_Start()
#define Delay(t) SIM_Delay(t)
#endif
/*******************************************************************
*
* Static data
*
********************************************************************
*/
#ifndef WIN32
/* Stacks */
// static OS_STACKPTR int Stack_0[600];
// static OS_STACKPTR int Stack_1[600];
// static OS_STACKPTR int Stack_2[600];
// static OS_TASK aTCB[3]; /* Task control blocks */
#endif
/*******************************************************************
*
* Static code
*
********************************************************************
*/
/*******************************************************************
*
* _cbCallbackT0
*/
__task void _Task_0(void);
__task void _Task_1(void);
__task void _GUI_Task(void);
__task void rt(void);
/*******************************************************************
*
* _Task_0
*/
void _Task_0(void) {
/* Create frame window */
//CreateCalculator();
while(1) {
Delay(10);
}
}
/*******************************************************************
*
* _Task_1
*/
void _Task_1(void) {
TP_Init();
while(1) {
Delay(10);
GUI_TOUCH_Exec ();
}
}
void _GUI_Task(void) {
_ExecCalibration();
while(1) {
GUI_Delay(10);
}
}
OS_TID t_id[7];
static U64 stk3[2000/8];
static U64 stk4[2000/8];
void main(void) {
/* Init GUI */
SystemInit();
os_sys_init(rt);
}
/*************************** End of file ****************************/
void rt(void)
{
WM_SetCreateFlags(WM_CF_MEMDEV);
GUI_Init();
/* Use memory devices on all windows to avoid flicker */
//WM_SetCallback(WM_HBKWIN, _cbBackgroundWin); /* Set callback for background window */
t_id[2]=os_tsk_create_user(_GUI_Task,1,&stk3,sizeof(stk3));
t_id[0]=os_tsk_create(_Task_1,5);
t_id[1]=os_tsk_create_user(_Task_0,5,&stk4,sizeof(stk4));
os_tsk_delete_self();
}