Timer in MyStarNetwork Demo

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Timer in MyStarNetwork Demo

1,683件の閲覧回数
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."); 
ラベル(1)
0 件の賞賛
返信
1 返信

867件の閲覧回数
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 件の賞賛
返信