本文整理汇总了C++中TimerStart函数的典型用法代码示例。如果您正苦于以下问题:C++ TimerStart函数的具体用法?C++ TimerStart怎么用?C++ TimerStart使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TimerStart函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TimerStart
void Context::clear() {
TimerStart("clear");
#ifdef _CTXH
ObjectMap::Entry *entry = mVars.first();
while (entry) {
if (entry->second) {
if (entry->second->refCount() <= 0) {
std::ostringstream oss;
oss << "*** Object in context has already been deleted";
throw std::runtime_error(oss.str());
}
entry->second->decRef();
}
entry = mVars.next();
}
#else
ObjectMap::iterator it = mVars.begin();
while (it != mVars.end()) {
if (it->second) {
if (it->second->refCount() <= 0) {
std::ostringstream oss;
oss << "*** Object \"" << it->first << "\" in context has already been deleted";
throw std::runtime_error(oss.str());
}
it->second->decRef();
}
++it;
}
#endif
mVars.clear();
TimerEnd("clear");
}
示例2: PapStart
void
PapStart(Link l, int which)
{
PapInfo pap = &l->lcp.auth.pap;
switch (which) {
case AUTH_PEER_TO_SELF: /* Just wait for peer's request */
break;
case AUTH_SELF_TO_PEER:
/* Initialize retry counter and timer */
pap->next_id = 1;
pap->retry = AUTH_RETRIES;
TimerInit(&pap->timer, "PapTimer",
l->conf.retry_timeout * SECONDS, PapTimeout, l);
TimerStart(&pap->timer);
/* Send first request */
PapSendRequest(l);
break;
default:
assert(0);
}
}
示例3: McpsConfirm
/*!
* \brief MCPS-Confirm event function
*
* \param [IN] mcpsConfirm - Pointer to the confirm structure,
* containing confirm attributes.
*/
static void McpsConfirm( McpsConfirm_t *mcpsConfirm )
{
if( mcpsConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
{
switch( mcpsConfirm->McpsRequest )
{
case MCPS_UNCONFIRMED:
{
// Check Datarate
// Check TxPower
break;
}
case MCPS_CONFIRMED:
{
// Check Datarate
// Check TxPower
// Check AckReceived
// Check NbTrials
break;
}
case MCPS_PROPRIETARY:
{
break;
}
default:
break;
}
// Switch LED 1 ON
GpioWrite( &Led1, 1 );
TimerStart( &Led1Timer );
}
NextTx = true;
}
示例4: TimerTest
/**********************************************************************
* TimerTest
* Description: Basic test of timer functionality
* Notes: Uses 1 timer slot - cannot be unregistered, only use for
* testing and debugging.
***********************************************************************/
void TimerTest( void)
{
uint8_t t1 = 0;
t1 = RegisterTimer(); //register the timer
TimerStart(t1, 1000L); //starts t1, 1 second interval
LED0_ON; //turn on the LED
while(TimerIsOn(t1)); //wait until timer has finished
//SAME THING FOR LED OFF
TimerStart(t1, 1000L); //starts t1, 1 second interval
LED0_OFF;
while(TimerIsOn(t1));
}
示例5: RicochetMenuHandleEvent
static void
RicochetMenuHandleEvent (EventPtr event)
{
switch (event->data.menu.itemID) {
case menuRicochetRestart:
RicochetRestart ();
break;
case menuRicochetNext:
RicochetNext ();
break;
case menuRicochetNew:
RicochetNext ();
break;
case menuTimerStart:
TimerStart ();
break;
case menuTimerStop:
TimerStop ();
break;
case menuHelpControls:
Help(controlForm);
break;
case menuHelpRules:
Rules ();
break;
case menuHelpGetInfo:
Help(infoForm);
break;
}
}
示例6: main
/*-----------------------------------------------------------------------------
* main
*/
int main(void) {
uint8_t ret;
int sioHdl;
/* set clock prescaler to 2 (set clock to 7.3928 MHz) */
CLKPR = 1 << CLKPCE;
CLKPR = 1;
/* get module address from EEPROM */
sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS);
GetClientListFromEeprom();
PortInit();
TimerInit();
ButtonInit();
PwmInit();
ApplicationInit();
SioInit();
SioRandSeed(sMyAddr);
/* sio for bus interface */
sioHdl = SioOpen("USART1", eSioBaud9600, eSioDataBits8, eSioParityNo,
eSioStopBits1, eSioModeHalfDuplex);
SioSetIdleFunc(sioHdl, IdleSio1);
SioSetTransceiverPowerDownFunc(sioHdl, BusTransceiverPowerDown);
BusTransceiverPowerDown(true);
BusInit(sioHdl);
spBusMsg = BusMsgBufGet();
/* warten for full operation voltage */
while (!POWER_GOOD);
/* enable ints before RestorePwm() */
ENABLE_INT;
TimerStart();
RestorePwm();
/* ext int for power fail: INT0 low level sensitive */
EICRA &= ~((1 << ISC01) | (1 << ISC00));
EIMSK |= (1 << INT0);
ApplicationStart();
/* Hauptschleife */
while (1) {
Idle();
ret = BusCheck();
ProcessBus(ret);
CheckButton();
PwmCheck();
ApplicationCheck();
CheckEvent();
}
return 0;
}
示例7: TimerUpdate
/********************************************************************
Function name: TimerUpdate
Input parameters:
Return:
Function:
********************************************************************/
void TimerUpdate(UINT32 TimerCnt)
{
TimerStop(T0);
TimerValSet(T0, TimerCnt);
TimerCpltFlagClr(T0);
TimerStart(T0);
TimerDoneChk(T0);
}
示例8: TimerToggle
static void
TimerToggle (void)
{
if (game.timer_running)
TimerStop ();
else
TimerStart ();
}
示例9: Init
virtual void Init(RobotInfo ri, NavInfo ni)
{
pid_trace_.Init();
if (0 < timer_) {
TimerStart(timer_);
}
local_status_ = MISSION_START;
}
示例10: LogicInit
/*************************************************
Function: LogicInit
Description:
Input:
Output:
Return:
Others:
*************************************************/
void LogicInit(void)
{
HarewareInit();
StorageInit();
GuiInit();
SetBeepIndex(_HW_BEEP_OK_);
TimerStart();
LogicSetMasterCtl(FRAME_ADDR_PC);
}
示例11: OnUltrasonicTimeout
/*!
* \brief Function executed on ultrasonic sensor timeout event
* If range and temperature readings not available in reasonable time
* sends sensor data with range and temperature in error
*/
static void OnUltrasonicTimeout ( void ) {
pc.printf("OnUltrasonicTimeout - Sensor FAULT\r\n");
SensorState = FAULT;
NextTx = true;
TimerSetValue( &TxNextPacketTimer, 100 ); // Schedule immediate transmission
TimerStart( &TxNextPacketTimer );
}
示例12: task_led_rtos
/*!
* task to blink led rtos between 1 seconds.
*/
void task_led_rtos( task_param_t param )
{
TimerInit(&Led1Timer, "Led1Timer", 250, OnLed1TimerEvent, false);
TimerInit(&Led2Timer, "Led2Timer", 250, OnLed2TimerEvent, false);
TimerInit(&Led3Timer, "Led3Timer", 250, OnLed3TimerEvent, false);
// Switch LED 1 ON
GpioWrite(&Led1, 0);
TimerStart(&Led1Timer);
while (1) {
if ( Led1TimerEvent == true ) {
Led1TimerEvent = false;
// Switch LED 1 OFF
GpioWrite(&Led1, 1);
// Switch LED 2 ON
GpioWrite(&Led2, 0);
TimerStart(&Led2Timer);
}
if ( Led2TimerEvent == true ) {
Led2TimerEvent = false;
// Switch LED 2 OFF
GpioWrite(&Led2, 1);
// Switch LED 3 ON
GpioWrite(&Led3, 0);
TimerStart(&Led3Timer);
}
if ( Led3TimerEvent == true ) {
Led3TimerEvent = false;
// Switch LED 3 OFF
GpioWrite(&Led3, 1);
// Switch LED 1 ON
GpioWrite(&Led1, 0);
TimerStart(&Led1Timer);
}
OSA_TimeDelay(50);
}
}
示例13: Init
virtual void Init(RobotInfo ri, NavInfo ni){
pid_trace_.Init();
straight_.Init(ri);
TimerStart(1000);
speed_ = 70;
local_status_ = P_START;
dist.x = ni.pos.X;
dist.y = ni.pos.Y;
dist.xy = (dist.x * dist.x) + (dist.y * dist.y);
}
示例14: osTimerInterruptInitialize
void osTimerInterruptInitialize(void)
{
/* ************ BEGIN TARGET SPECIFIC SECTION **************/
TimerInterval(0);
(VPint(TDATA(0))) = gBUSCLK/100;
TimerStart(0);
Enable_Int(TIMER0_INT);
/* ************ END TARGET SPECIFIC SECTION **************/
}
示例15: InitTimers
/*****************************************************************
* init timer1
* Init timer hardware if needed here
******************************************************************/
void InitTimers(void)
{
//SETUP ANY HARDWARE AS NEEDED
//CHECKOUT THE TIMERS THAT WILL BE USED IN THE SYSTEM
timer_pb = RegisterTimer(); //register the timer
//START THE TIMERS IF THEY ARE FREE RUNNING
TimerStart(timer_pb, TIME_PB0); //restart the time
}