当前位置: 首页>>代码示例>>C++>>正文


C++ TimerStart函数代码示例

本文整理汇总了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");
}
开发者ID:gatgui,项目名称:fbpg,代码行数:32,代码来源:context.cpp

示例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);
	}
}
开发者ID:vstakhov,项目名称:mpd,代码行数:27,代码来源:pap.c

示例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;
}
开发者ID:Lora-net,项目名称:LoRaMac-node,代码行数:40,代码来源:main.c

示例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));

}
开发者ID:andygikling,项目名称:logi-tools,代码行数:22,代码来源:Timers.c

示例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;

    }
}
开发者ID:ricochet-robotics,项目名称:rr-palmpilot-c,代码行数:33,代码来源:main.c

示例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;
}
开发者ID:busmaster,项目名称:homebus,代码行数:62,代码来源:main.c

示例7: TimerUpdate

/********************************************************************
Function name:    TimerUpdate
Input parameters:
    
Return:
    
Function:
    
********************************************************************/
void TimerUpdate(UINT32 TimerCnt)
{
    TimerStop(T0);
    TimerValSet(T0, TimerCnt);
    TimerCpltFlagClr(T0);
    TimerStart(T0);
    TimerDoneChk(T0);
}
开发者ID:296791897,项目名称:keilprj,代码行数:17,代码来源:BankCertificate.c

示例8: TimerToggle

static void
TimerToggle (void)
{
    if (game.timer_running)
        TimerStop ();
    else
        TimerStart ();
}
开发者ID:ricochet-robotics,项目名称:rr-palmpilot-c,代码行数:8,代码来源:main.c

示例9: Init

    virtual void Init(RobotInfo ri, NavInfo ni)
	{
        pid_trace_.Init();
		if (0 < timer_) {
			TimerStart(timer_);
		}
		local_status_ = MISSION_START;
    }
开发者ID:masahiro-nakatani,项目名称:robocon,代码行数:8,代码来源:MissionCourseG1.cpp

示例10: LogicInit

/*************************************************
  Function:		LogicInit
  Description:  
  Input:		
  Output:		
  Return:		
  Others:
*************************************************/
void LogicInit(void)
{
	HarewareInit();
	StorageInit();
    GuiInit();
	SetBeepIndex(_HW_BEEP_OK_);
    TimerStart();
    LogicSetMasterCtl(FRAME_ADDR_PC);
}
开发者ID:txl0591,项目名称:InputDevices,代码行数:17,代码来源:Logic.c

示例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 );

}
开发者ID:Suretronic,项目名称:nz32ultrasonic,代码行数:14,代码来源:main.cpp

示例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);
    }
}
开发者ID:AlexanderWiniger,项目名称:LoRaMac-node,代码行数:46,代码来源:main.c

示例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);
    }
开发者ID:masahiro-nakatani,项目名称:robocon,代码行数:10,代码来源:MissionLookupGate.cpp

示例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 **************/
}
开发者ID:Sundarapandian,项目名称:avr_projects,代码行数:10,代码来源:interrupt.c

示例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

}
开发者ID:andygikling,项目名称:logi-tools,代码行数:15,代码来源:Timers.c


注:本文中的TimerStart函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。