cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin : How call a subdialog from a "first dialog" window ?

lidiriel
Associate II

Hello, I test stm32 with the board STM32F746G-DISCO.

I test the library STemWIn for touch screen. I have create a first dialog (with GUI_CreateDialogBox() ) with a button to launch a second dialog with : GUI_CreateDialogBox() method. But when the second dialog is displayed i can't click on any button. It's seem that the touch screen don't react.

In the main code i have the code :

CreateADCWindow(&trigger, &frequency, &gate);
  while (1) {
      BSP_TouchUpdate();
      GUI_Delay(10);
  }

CreateADCWindow launch the first screen. Perhaps what is missing in my BSP_TouchUpdate() function ?

void BSP_TouchUpdate(){
  GUI_PID_STATE TS_State;
  static TS_StateTypeDef prev_state;
  TS_StateTypeDef  ts;
  uint16_t xDiff, yDiff;
 
  BSP_TS_GetState(&ts);
  if(ts.touchDetected > 0)
    ts.touchDetected = 1;
  TS_State.Pressed = ts.touchDetected;
 
  xDiff = (prev_state.touchX[0] > ts.touchX[0]) ? (prev_state.touchX[0] - ts.touchX[0]) : (ts.touchX[0] - prev_state.touchX[0]);
  yDiff = (prev_state.touchY[0] > ts.touchY[0]) ? (prev_state.touchY[0] - ts.touchY[0]) : (ts.touchY[0] - prev_state.touchY[0]);
 
 
  if((prev_state.touchDetected != ts.touchDetected ) && ((xDiff > 3 ) || (yDiff > 3)))
    {
      if(ts.touchDetected > 0)
	ts.touchDetected = 1;
      TS_State.Layer = 0;
      TS_State.x = ts.touchX[0];
      TS_State.y = ts.touchY[0];
      GUI_TOUCH_StoreStateEx(&TS_State);
    }
  prev_state = ts;
}

After debugging when the second screen is launch. Debbugger doesn't go into BSP_TouchUpdate(). it'is like the second screen is blocked...

1 REPLY 1

Using what debugger? Is it invasive, or other threads with real-time expectations or timeouts that don't play well with human dithering? I2C interrupts? Timeouts, overflows, recovery thereof?

Consider instrumenting code so you can output via USART or SWV and watch interaction, and variables without dead-stopping the machine to single-step or understand code flow.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..