12-14-2010 05:36 PM
Hi AbsolutelyAndrew,
can you post a reduced version of your program that shows up the behaviour you are observing? This would make easier to discuss on this problem, as it seems that usual causes of unexpected behaviour related to tabs have already been addressed in your code.
12-15-2010 03:35 AM
@AbsolutelyAndrew wrote:
My start and stop timer functions:
void StopIMUTimer(void)
{
SetCtrlAttribute(panelHandle,PANEL_IMU_TIMER, ATTR_ENABLED, 0); //Stop Timer
}
void StartIMUTimer(void)
{
ResetTimer(panelHandle,PANEL_IMU_TIMER);
SetCtrlAttribute(panelHandle,PANEL_IMU_TIMER, ATTR_ENABLED, 1); //Start Timer
}
I'm using the callback generated by the tab control. For EVENT_ACTIVE_TAB_CHANGE, if the tab in question is active, the timer is started. If it is not active, the timer is stopped.
Using this methodology, no timer callback should occur after StopIMUTimer(), correct?
It depends what you mean by "no timer callback should occur". If you have a conventional switch() statement inside the timer callback which is filtering on EVENT_TIMER_TICK, then you are correct in that this code should not be executed. There is also an EVENT_DISCARD, which could be being called at the point of QuitUserInterface() - so it is possible for the callback to still be invoked with this event. As long as you have software in place to check the event code there should not be a problem.
JR
12-15-2010 03:15 PM
JR has hit the nail on the head. Well done, and thank you.