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:
Display All
main:
Display All
createwindow:
Help me please
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
- void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) // timer interrupt
- {
- BSP_Pointer_Update();
- }
- uint8_t press;
- int X,Y;
- void BSP_Pointer_Update(void)
- {
- GUI_PID_STATE TS_State;
- if(HAL_GPIO_ReadPin(IRQ_GPIO_Port, IRQ_Pin)==0)
- {
- press=1;
- TS_State.Layer=0;
- TS_State.Pressed=press;
- X=TS_ReadX(); // reading x
- Y=TS_ReadY(); // reading y
- TS_State.x=X;
- TS_State.y=Y;
- GUI_TOUCH_StoreStateEx(&TS_State);
- }
- //
- if((press==1)&(HAL_GPIO_ReadPin(IRQ_GPIO_Port, IRQ_Pin)==1))
- {
- press=0;
- TS_State.Layer=0;
- TS_State.Pressed=press;
- TS_State.x=X;
- TS_State.y=Y;
- GUI_TOUCH_StoreStateEx(&TS_State);
- }
- }
main:
Source Code
- __HAL_RCC_CRC_CLK_ENABLE();
- //ili9486_Init();
- //WM_SetCreateFlags(WM_CF_MEMDEV);
- GUI_Init();
- GUI_Clear();
- HAL_TIM_Base_Start_IT(&htim14); //start timer interrupt
- CreateWindow();
- HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET);
- while (1)
- {
- GUI_Delay(10);
- HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
- HAL_Delay(100);
- }
createwindow:
Help me please