This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Touchscreen not responding

Hello I am trying to make a simple application using emWin library which creates a button on LCD screen and if a button is pressed then turn on a LED diode but touchscreen is not responding to click. Can you tell me where do I make a mistake?

int main(void)
{
        BUTTON_Handle hButton;
  /* 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();

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

  /* Configure the system clock to 180 MHz */
  SystemClock_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 = 5000 - 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 */
  GUI_Init();
  GUI_Initialized = 1;

  /* Initialize RTC and Backup */
  RTC_Init();

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

  /* Do the calibration if needed */
  CALIBRATION_Check();

  /* Start Demo */
hButton = BUTTON_CreateEx(20, 50, 219, 30, 0, WM_CF_SHOW, 0, GUI_ID_BUTTON0);
         BUTTON_SetText(hButton, "XXX");
    BUTTON_SetFont(hButton, &GUI_Font8x15B_ASCII);
        GUI_Exec();
        while (1)
{

         if (GUI_GetKey()==GUI_ID_BUTTON0) {
            /* Led Off */
            HAL_GPIO_TogglePin(GPIOG,GPIO_PIN_13);

            /* Stop while loop */
            break;

                }

}