Esempio n. 1
0
/**
  * @brief  Start task
  * @param  argument: pointer that is passed to the thread function as start argument.
  * @retval None
  */
static void GUIThread(void const * argument)
{  
  /* Check for calibration */
  if(k_CalibrationIsDone() == 0)
  {
    k_CalibrationInit();
  }  
  
  /* Demo Startup */
  k_StartUp();   
  
  /* Initialize Storage Units */
  k_StorageInit(); 
  
  /* Initialize audio Interface */
  k_BspAudioInit(); 
  
  /* Show the main menu */
  k_InitMenu();
    
  /* Gui background Task */
  while(1) {
    GUI_Exec(); /* Do the background work ... Update windows etc.) */    
    osDelay(20); /* Nothing left to do for the moment ... Idle processing */
    GUI_FreeMem = GUI_ALLOC_GetNumFreeBytes();

  }
}
Esempio n. 2
0
/**
  * @brief  Start task
  * @param  argument: pointer that is passed to the thread function as start argument.
  * @retval None
  */
static void GUIThread(void const * argument)
{    
  /* Initialize Storage Units */
  k_StorageInit();  

  if(k_CalibrationIsDone() == 0)
  {
    k_CalibrationInit();
  }
  
  /* Demo Startup */
  k_StartUp();
  
  
  /* Show the main menu */
  k_InitMenu();
  
  /* Gui background Task */
  while(1)
  {
    GUI_Exec();  
    /* Toggle LED3 and LED4 */
    BSP_LED_Toggle(LED3);
    BSP_LED_Toggle(LED4);     
    osDelay(20); 
    GUI_FreeMem = GUI_ALLOC_GetNumFreeBytes();
  }
}
Esempio n. 3
0
/**
  * @brief  Read the coordinate of the point touched and assign their
  *         value to the variables u32_TSXCoordinate and u32_TSYCoordinate
  * @param  None
  * @retval None
  */
void k_TouchUpdate(void)
{
  GUI_PID_STATE TS_State;
  static TS_StateTypeDef prev_state;
  __IO TS_StateTypeDef  ts;
  uint16_t xDiff, yDiff;

  BSP_TS_GetState((TS_StateTypeDef *)&ts);

  TS_State.Pressed = ts.TouchDetected;

  xDiff = (prev_state.x > ts.x) ? (prev_state.x - ts.x) : (ts.x - prev_state.x);
  yDiff = (prev_state.y > ts.y) ? (prev_state.y - ts.y) : (ts.y - prev_state.y);

  if((prev_state.TouchDetected != ts.TouchDetected )||
     (xDiff > 3 )||
       (yDiff > 3))
  {
    prev_state.TouchDetected = ts.TouchDetected;

    if((ts.x != 0) &&  (ts.y != 0))
    {
      prev_state.x = ts.x;
      prev_state.y = ts.y;
    }

    if(k_CalibrationIsDone())
    {
      TS_State.Layer = 0;
      TS_State.x = k_CalibrationGetX (prev_state.x);
      TS_State.y = k_CalibrationGetY (prev_state.y);
    }
    else
    {
      TS_State.Layer = 0;
      TS_State.x = prev_state.x;
      TS_State.y = prev_state.y;
    }

    GUI_TOUCH_StoreStateEx(&TS_State);
  }
}
Esempio n. 4
0
/**
  * @brief  Start task
  * @param  argument: pointer that is passed to the thread function as start argument.
  * @retval None
  */
static void GUIThread(void const * argument)
{
  /* Set General Graphical proprieties */
  k_SetGuiProfile();
    
  if(k_CalibrationIsDone() == 0)
  {
    GUI_SelectLayer(1);
    k_CalibrationInit();
    GUI_SelectLayer(0);
  }
  
  /* Show the main menu */
  k_InitMenu();
  
  /* Gui background Task */
  while(1)
  {
    GUI_Exec();       
    osDelay(30); 
  }
}