We are using EmbeddedWizard 8.3 on an STM32f429 project on bare metal with a GUI consisting of various screens, some of which have a SlideTouchHandler hooked up to a VerticalList. We use these to set things such as hours and minutes. When starting to scroll an item, there is an initial delay before scrolling starts.This problem also occurs when scrolling widgets vertically or horizontally. We are using double buffering for the display.
Currently we are using the code below, which is called during the idle time of the rest of the application:
/* receive touch inputs and provide the application with them */
if ( EwBspGetTouchPosition( &touchPos ))
{
/* begin of touch cycle */
if ( touched == 0 )
CoreRoot__DriveCursorHitting( rootObject, 1, 0, touchPos );
/* movement during touch cycle */
else if ( touched == 1 )
CoreRoot__DriveCursorMovement( rootObject, touchPos );
touched = 1;
events = 1;
}
/* end of touch cycle */
else if ( touched == 1 )
{
CoreRoot__DriveCursorHitting( rootObject, 0, 0, touchPos );
touched = 0;
events = 1;
}
/* process expired timers */
timers = EwProcessTimers();
/* process the pending signals */
signals = EwProcessSignals();
/* refresh the screen, if something has changed and draw its content */
if ( devices || timers || signals || events )
{
Update( viewport, rootObject );
/* after each processed message start the garbage collection */
EwReclaimMemory();
/* print current memory statistic to serial interface - uncomment if needed */
/* EwPrintProfilerStatistic( 0 ); */
}
/* otherwise sleep/suspend the UI application until a certain event occurs or a timer expires... */
else
{
EwBspWaitForSystemEvent( EwNextTimerExpiration());
}
I can reduce the delay significantly if I replace the EwBspWaitForSystemEvent( EwNextTimerExpiration()); with a simple delay of 2 ms (HAL_Delay(2)).
My questions are:
1. Is it OK to replace EwBspWaitForSystemEvent( EwNextTimerExpiration()); with a simple delay? All that EwNextTimerExpiration() does is return the next timer expiry and EwBspWaitForSystemEvent() waits a maximum ot 10ms.
2. Are there any other things I can do to reduce the scolling lag?