timer options - 13213 evaluation kit

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

timer options - 13213 evaluation kit

1,777 次查看
moti
Contributor I
I want to add an interval between the messages on the screen. I tried the timer that attached in the script file but I can't see any different behavior. What is the problem and what can I use instead. Thank you.
(The conrtroller is MC9S08GB60 in the - 13213 Evaluation Kit )
the script\code (mapp.c) "MyStarNetworkApp":
  /*print a message on the LCD also*/
            LCD_ClearDisplay();
            LCD_WriteString(1,"Ready to send");
            LCD_WriteString(2,"and receive data");    
    
            //TMR_FreeTimer(tmrTimerID_t timerID);
           TMR_StartIntervalTimer( mSoftTimerId_c, TmrMinutes(1), App_IntervalTimeoutHandler);
           Led1Flashing();
            LCD_ClearDisplay();
            LCD_WriteString(1,"Press 'OK' on");
            LCD_WriteString(2,"the red butten");    
          TMR_StartIntervalTimer( mSoftTimerId_c, TmrMinutes(1), App_IntervalTimeoutHandler);  
           LCD_ClearDisplay();
            LCD_WriteString(1,"Starting");
            LCD_WriteString(2,"report");  
           gState = stateListen;
      TS_SendEvent(gAppTaskID_c, gAppEvtDummyEvent_c);
          }
        }
      }     
标签 (1)
0 项奖励
回复
1 回复

1,056 次查看
Mads
Contributor V
Moti,
 
I think you have misunderstood how the timers works.
TMR_StartIntervalTimer() will start a timer, that calls the callback function (IntervalTimeoutHandler() in your code) every time X milliseconds have occoured ( TmrMinutes(1) in your case).
 
The TMR_StartIntervalTimer() is not a "blocking mode" delay function as you seem to be using it for.
 
Please try reading chapter 3 in the Freescale platform reference manual as it explains how the timers are used.
 
/Mads
0 项奖励
回复