/* Upcall function for touch panel activity. 
This function is call from TOUCH driver every time pen state is changed (up/down) or is moved. There is translation to emWin structure done.  */
void LCD_TOUCH_Upcall(TOUCH_Pos_TypeDef *pos)
/* Upcall function for touch panel activity. 
This function is call from TOUCH driver every time pen state is changed (up/down) or is moved. There is translation to emWin structure done.  */
void LCD_TOUCH_Upcall(TOUCH_Pos_TypeDef *pos)
{ static GUI_PID_STATE gui_pos;
  if(pos->x < LCD_GetXSize()) gui_pos.x = pos->x;
    else gui_pos.x = LCD_GetXSize()-1;
  if(pos->y < LCD_GetYSize()) gui_pos.y = pos->y;
    else gui_pos.y = LCD_GetYSize()-1;
  gui_pos.Pressed = pos->pen;
  GUI_TOUCH_StoreStateEx(&gui_pos);
}