Timer in MyStarNetwork Demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer in MyStarNetwork Demo

1,173 Views
moti
Contributor I
Hi
We tried to use this function: (in 13213 evk board in MyStarNetwork Demo program)
TMR_StartSingleShotTimer(mSoftTimerId_c, mWaitInterval_c, App_IntervalTimeoutHandler);
but we didnt see any delay after it !
what can we change or what do we need to add
thank you
moti 
 
see below the code
 LCD_ClearDisplay(); 
  LCD_WriteString(1,"Press any key");
  LCD_WriteString(2,"to start."); 
TMR_StartSingleShotTimer(mSoftTimerId_c, 4000_c, App_IntervalTimeoutHandler);
LCD_ClearDisplay(); 
  LCD_WriteString(1,"are you");
  LCD_WriteString(2,"sure."); 
Labels (1)
0 Kudos
1 Reply

357 Views
Mads
Contributor V
Moti,
 
I think you are misunderstanding how the TMR_StartSIngleshotTimer() works.
It is not a "blocking mode" delay function.
It starts a timer that expires after an interval. When the timer expires the callback is called.
Also you should not use the Callback that is used by another timer, you should make your own - e.g.
 
static tmrTimerID_t mDelayTimerId;
 
void testfunction(void)
{
mDelayTimerId = TMR_AllocateTimer(); // should only be done once!!
LCD_ClearDisplay(); 
  LCD_WriteString(1,"Press any key";
  LCD_WriteString(2,"to start."
 TMR_StartSingleShotTimer(mDelayTimerId_c, 4000_c, DisplayTimeoutHandler);
}
 
void DisplayTimeoutHandler((uint8_t timerID)
(void) timerID;
 LCD_ClearDisplay(); 
  LCD_WriteString(1,"are you";
  LCD_WriteString(2,"sure."
}
 
 
Look in the Beestack Generic app for example on how the timer can be used to drive delays between different states.
 
BR,
Mads,
0 Kudos