Esempio n. 1
0
/*********************************************************************
*
*       GUITASK_AssertNoLock
*
*/
void GUITASK_AssertNoLock(void) {  
  GUI_Lock();
  if (GUITASK__EntranceCnt > 1) {
    GUI_DEBUG_ERROROUT("GUITASK.c: GUITASK_AssertNoLock failed!");
  }
  GUI_Unlock();
}
/*******************************************************************
*
*       _DemoRandomGraph
*/
static void _DemoRandomGraph(void) {
  PARAM Param;
  int tDiff, t0;
  GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};
  GUI_HMEM hMem = GUI_ALLOC_AllocZero((LCD_XSIZE - 20) * sizeof(I16));
  GUI_SetColor(GUI_WHITE);
  GUI_SetBkColor(GUI_RED);
  GUI_ClearRect(0, 55, LCD_XSIZE, 75);
  GUI_SetFont(&GUI_FontComic18B_1);
  GUI_DispStringAt("Random graph", 20, 55);
  GUI_Lock();
  Param.aY = GUI_ALLOC_h2p(hMem);
  GUI_SetFont(&GUI_Font6x8);
  t0 = GUI_GetTime();
  while((tDiff = (GUI_GetTime() - t0)) < 10000) {
    int t1, tDiff2;
    _GetRandomData(Param.aY, tDiff, (LCD_XSIZE - 20));
    t1 = GUI_GetTime();
    GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);
    tDiff2 = GUI_GetTime() - t1;
    if (tDiff2 < 100) {
      GUI_Delay(100 - tDiff2);
    }
  }
  GUI_Unlock();
  GUI_ALLOC_Free(hMem);
}
Esempio n. 3
0
/*********************************************************************
*
*       GUITASK_GetpContext
*
*/
GUI_CONTEXT * GUITASK_GetpContext(int Index) {
  GUI_CONTEXT * pContext;
  pContext = NULL;
  GUI_Lock();
  if (Index < GUI_MAXTASK) {
    pContext = &_Save[Index].Context;
  }
  GUI_Unlock();
  return pContext;
}
Esempio n. 4
0
void GUI_LongString_Task(void *arg)
{	
    __u32                   i;
    __bool                  move_flags = ORANGE_FALSE;
	
	while(1)
    {
       	if(esKRNL_TDelReq(EXEC_prioself) == OS_TASK_DEL_REQ)
       	{
   			break;
       	}
		orange_Dalay(40);	

        LONGSTR_LOCK();
        for(i = 0;i < MAX_NR_SHOW;i++)
        {
            if(gshow_info[i])
            {
                if(gshow_info[i]->status == LONGSTRING_MOVE)
                {
                    move_flags = ORANGE_TRUE;
                    break;
                }
            }
        }
        LONGSTR_UNLOCK();

        if(i == MAX_NR_SHOW)
        {
            move_flags = ORANGE_FALSE;
        }
        
        if(move_flags == ORANGE_FALSE)
        {
            /*need not move*/
            sem_wait (&run_sem);
        }  
	
		if (GUI_LockAccept() == EPDK_OK)
		{	
            LONGSTR_LOCK();
            
            for(i = 0;i < MAX_NR_SHOW;i++)
            {
                if(gshow_info[i] && gshow_info[i]->status == LONGSTRING_MOVE)
                {
			        GUI_LongStringMove(gshow_info[i]);

                    orange_Dalay(10);
                }
            }

            LONGSTR_UNLOCK();
			
			GUI_Unlock();
		}
	}	
    
	esKRNL_TDel(EXEC_prioself);
    
	return;
}