crash after touch

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • crash after touch

      Hi.

      am using resistive touch screen with xpt2046 driver. touch driver return coordinate successfully.
      the gui works fine after initial but after touching get crash.

      touch:

      Source Code

      1. void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) // timer interrupt
      2. {
      3. BSP_Pointer_Update();
      4. }
      5. uint8_t press;
      6. int X,Y;
      7. void BSP_Pointer_Update(void)
      8. {
      9. GUI_PID_STATE TS_State;
      10. if(HAL_GPIO_ReadPin(IRQ_GPIO_Port, IRQ_Pin)==0)
      11. {
      12. press=1;
      13. TS_State.Layer=0;
      14. TS_State.Pressed=press;
      15. X=TS_ReadX(); // reading x
      16. Y=TS_ReadY(); // reading y
      17. TS_State.x=X;
      18. TS_State.y=Y;
      19. GUI_TOUCH_StoreStateEx(&TS_State);
      20. }
      21. //
      22. if((press==1)&(HAL_GPIO_ReadPin(IRQ_GPIO_Port, IRQ_Pin)==1))
      23. {
      24. press=0;
      25. TS_State.Layer=0;
      26. TS_State.Pressed=press;
      27. TS_State.x=X;
      28. TS_State.y=Y;
      29. GUI_TOUCH_StoreStateEx(&TS_State);
      30. }
      31. }
      Display All


      main:

      Source Code

      1. __HAL_RCC_CRC_CLK_ENABLE();
      2. //ili9486_Init();
      3. //WM_SetCreateFlags(WM_CF_MEMDEV);
      4. GUI_Init();
      5. GUI_Clear();
      6. HAL_TIM_Base_Start_IT(&htim14); //start timer interrupt
      7. CreateWindow();
      8. HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET);
      9. while (1)
      10. {
      11. GUI_Delay(10);
      12. HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
      13. HAL_Delay(100);
      14. }
      Display All

      createwindow:

      Source Code

      1. WM_HWIN CreateWindow(void) {
      2. WM_HWIN hWin;
      3. hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
      4. return hWin;
      5. }
      ?(



      Help me please :pinch: