• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Idle函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Idle函数的典型用法代码示例。如果您正苦于以下问题:C++ Idle函数的具体用法?C++ Idle怎么用?C++ Idle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Idle函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: KGLogPrintf

void KGatewaytest::TestUserLoginPaysysNeedMibaoPaysysNoRespond()   // caseID:
{
    int nResult  = false;
    int nRetCode = false;
    char szTestCaseDscribe[] = "// caseID????:,测试Paysys返回登陆账号密码正确,需要密保验证时,客户端已经输入密保矩阵,但paysys不返回验证结果,Client玩家收到密保密码错误";
    KG_RETURN_RESULT Result;

    KGLogPrintf(KGLOG_INFO, "caseID????:\n");

    FillTestUserLoginInfo(KG_USER_MIBAO, ACTION_SUCCESS, AccountUserLoginInfo,  PASSPODMODE_ZPMATRIX, ACTION_SUCCESS, false, false, ACTION_FAILED, true);

    nRetCode = InitTestEnvironment(true, true, true, 1, m_GatewayTestConfig.ForecastConfig.nTestPoint);
    KGLOG_PROCESS_ERROR(nRetCode);
    m_GatewayTestConfig.PaysysManagerConfig.nNotRespondSubProtocol = AccountUserPasspodVerify;

    nRetCode = m_pClientController->FillOperate(
        3,
        onConnectToGateway,
        onHandShake,
        onAccountVerify
        //onMibaoVerify
    );
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = m_pClientController->Run();
    KGLOG_PROCESS_ERROR(nRetCode);

    Idle(70);
    nRetCode = m_pPaysys->SetAccountVerifyRespondType(AccountUserPasspodVerifyRet, PASSPODMODE_ZPMATRIX, ACTION_FAILED);
    KGLOG_PROCESS_ERROR(nRetCode);
    nRetCode = m_pClientController->AddOperateToClient(0, 1, onMibaoVerify);
    KGLOG_PROCESS_ERROR(nRetCode);
    Idle(70);

    nRetCode = m_pClientController->GetReturnResult(0, &Result);
    KGLOG_PROCESS_ERROR(nRetCode);

    nRetCode = memcmp(&Result, &(m_GatewayTestConfig.ForecastConfig), sizeof(Result));
    KGLOG_PROCESS_ERROR(!nRetCode);

    nResult = true;
Exit0:
    UnInitTestEnvironment();
#ifdef WIN32
    {
        KG_CASE_INFO(szTestCaseDscribe, "");
        KG_CPPUNIT_ASSERT(nResult);
    }
#else
    {
        //InsertInfo(CASEPURPOSE, (szTestCaseDscribe));
        //InsertInfo(PRECONDITION, (""));
        CPPUNIT_ASSERT(nResult);
    }
#endif
}
开发者ID:viticm,项目名称:pap2,代码行数:56,代码来源:SO3GatewayTestUserLogin.cpp


示例2: GetInput

signed char GetInput(void) {
    signed char ret = 0;
    ClearUI_Event = 1;
    while (ClearUI_Event) Idle();

    while (ret == 0) {
        bLock_UI_Event = 1;
        ret = UI_Event;
        bLock_UI_Event = 0;
        Idle();
    }
    return ret;
}
开发者ID:Demolitron,项目名称:CineFluxOrbitFirmware,代码行数:13,代码来源:UserInterface.c


示例3: if

void Transceiver::StopListen()
{
   if (Connected()){
      if   (timer.Cycle()<(_helloCycle+20))  //check 1min
          Idle();
      if  (timer.Cycle()>_helloCycle+100)  //after 5min without knock
         Deconnect();
   } else {
     if (timer.Cycle() >(_KnockCycle+60)){   // check 3 min
        DBGINFO("StopListen");
        Idle();
     }
   }
}
开发者ID:Slyb00ts,项目名称:imwave,代码行数:14,代码来源:imtrans.cpp


示例4: Keyboard

/*keybord function
@param[in] key, the type of the key
@param[in] x,y : the current position of the mouse
*/
void Keyboard(unsigned char key, int x, int y)
{
	int mod = glutGetModifiers();		//the state(Shift,Ctrl,Alt)

	switch(key){
	case '\033': // the ASCII code of ESC
		OnExitApp();
		break;

	case ' ':	//idle
		Idle();
		break;

	case 's':	//animation ON/OFF
		SwitchIdle(-1);
		break;

	case 'F':   //Fullscreen
		SwitchFullScreen();
		break;

	default:	//drawing flag
		{
			int idx = 0;
			while(RX_DRAW_STR[2*idx]!="-1"&&(int)RX_DRAW_STR[2*idx+1][0]!=key) idx++;
			if(RX_DRAW_STR[2*idx]!="-1"){
				g_iDraw=(0x01<<idx);
			}
		}
		break;
	}
	glutPostRedisplay();
}
开发者ID:DonDracula,项目名称:OpenGL_projects,代码行数:37,代码来源:glmain.cpp


示例5: ExchangeBlackboard

void
GlueMapWindow::OnPaintBuffer(Canvas &canvas)
{
#ifdef ENABLE_OPENGL
    ExchangeBlackboard();

    EnterDrawThread();

    /* update terrain, topography, ... */
    if (Idle())
        /* still dirty: schedule a redraw to load more data */
        data_timer.Schedule(500);
    else
        data_timer.Cancel();
#endif

    MapWindow::OnPaintBuffer(canvas);

    DrawMapScale(canvas, GetClientRect(), render_projection);
    if (IsPanning())
        DrawPanInfo(canvas);

#ifdef ENABLE_OPENGL
    LeaveDrawThread();
#endif
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:26,代码来源:GlueMapWindowEvents.cpp


示例6: Key

static void Key( unsigned char key, int x, int y )
{
   const GLfloat step = 3.0;
   (void) x;
   (void) y;
   switch (key) {
      case 'a':
         Anim = !Anim;
         if (Anim)
            glutIdleFunc(Idle);
         else
            glutIdleFunc(NULL);
         break;
      case 's':
         Idle();
         break;
      case 'z':
         Zrot -= step;
         break;
      case 'Z':
         Zrot += step;
         break;
      case ' ':
         Init();
         break;
      case 27:
         exit(0);
         break;
   }
   glutPostRedisplay();
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:31,代码来源:manytex.c


示例7: main

int main(int argc, char* argv[]) {
	BYTE Buttons;
	printf("Example2: ByteIO\n");

#ifdef OnOSX
	signal(SIGINT, Quit);		// Trap Control+C function Quit on Mac
#endif

	if (!InitializeForByteIO()) {
		printf("\nFT232R cable found\n");
// Configure Buttons to be input
		WriteI2CByte(0xFF, ConfigurationRegister, ButtonsAddress);
// Setup Buttons(InputPortRegister) as the default register
		WriteI2CByte(0xAA, InputPortRegister, ButtonsAddress);
// Configure Lights to be output
        WriteI2CByte(0, ConfigurationRegister, LightsAddress);
        WriteI2CByte(0, ConfigurationRegister, DigitLSB);
		for (int i=0; i<100; i++) {
			Buttons = ReadI2CByte(ButtonsAddress);
			printf("\rButtons = %2.2X", Buttons);
//			BYTE Answer = (Buttons & 0xF) * ((Buttons>>4) & 0xF);
			WriteI2CByte(Buttons, OutputPortRegister, LightsAddress);
			WriteI2CByte(SevenSegmentLookup[i&0xf], OutputPortRegister, DigitLSB);
			Idle(1000);
			}
		}
	Quit();
	}
开发者ID:jjturn,项目名称:lb-boards,代码行数:28,代码来源:Example2.cpp


示例8: quit

void quit() {

	char string[StringSize];

	my_log("POLYGLOT *** QUIT ***\n");

	if (Init) {

		stop_search();
		engine_send(Engine,"quit");

		// wait for the engine to quit
#ifndef _WIN32 
		while (true) {
			engine_get(Engine,string,sizeof(string)); // HACK: calls exit() on receiving EOF
		}
#else     
		Idle500msecs();//
		while(peek_engine_get(Engine,string,StringSize))
			Idle();
#endif
		uci_close(Uci);
	}

	exit(EXIT_SUCCESS);
}
开发者ID:GordCaswell,项目名称:lucaschessportable,代码行数:26,代码来源:main.cpp


示例9: QF_onIdle

/*..........................................................................*/
void QF_onIdle(void) {          /* entered with interrupts disabled, NOTE01 */

    LED_ON (IDLE_LED);                    /* blink the IDLE LED, see NOTE02 */
    LED_OFF(IDLE_LED);

#ifdef Q_SPY
    QF_INT_ENABLE();                       /* enable interrupts, see NOTE01 */

    while (U2STAbits.UTXBF == 0U) {                  /* TX Buffer not full? */
        uint16_t b;

        QF_INT_DISABLE();
        b = QS_getByte();
        QF_INT_ENABLE();

        if (b == QS_EOD) {                          /* End-Of-Data reached? */
            break;                                 /* break out of the loop */
        }
        U2TXREG = (uint8_t)b;   /* stick the byte to TXREG for transmission */
    }
#elif defined NDEBUG
    __asm__ volatile("disi #0x0001");
    Idle();                          /* transition to Idle mode, see NOTE03 */
#else
    QF_INT_ENABLE();                       /* enable interrupts, see NOTE01 */
#endif
}
开发者ID:SmartCocktailFactory,项目名称:QP_LWIP_STM32F2xx_eth_DPP_Example,代码行数:28,代码来源:bsp.c


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


示例11:

Enemy::Enemy(double x, double y, const std::string &name):
    PE::Ai(x, y, name)
    {
    speed = 50.0;
    stateMachine.addState(Idle(stateMachine, *this));
    stateMachine.changeState(IDLE_ID);
    SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Debug", "initStateMachine done", NULL);
    }
开发者ID:topikuure,项目名称:ProtoEngine,代码行数:8,代码来源:game_entity.cpp


示例12: Idle

void Transceiver::StopListenBroadcast()
{
   if (Connected()&& (timer.Cycle()<(_helloCycle+20)) ) //check 3min
    {
     Idle();
//     timer.setStage(IMTimer::IDDLESTAGE);
   }
}
开发者ID:Slyb00ts,项目名称:imwave,代码行数:8,代码来源:imtrans.cpp


示例13: NextEv

// vrati proces jehoz aktivni faze bude zahajena po potlaceni tohoto procesu
CProcess* CProcess::NextEv()
{
    if (Idle()) return NULL;    // proces nema zaznam o udalosti
    if (event->Suc() == NULL) 
        return NULL;            // udalost procesu nema naslednika
    
    return ((CEventNotice*)event->Suc())->proc;
}
开发者ID:mormegil-cz,项目名称:fel-cvut,代码行数:9,代码来源:Simulation.cpp


示例14: WriteBits

void WriteBits(UCHAR Value) {
	DWORD BytesWritten;
	FT_Status = FT_Write(FT_Handle, &Value, 1, &BytesWritten);
	if (FT_Status != FT_OK) {
		printf("\nFT_Write error (%d), Cable disconnected?\n", FT_Status);
		Idle(2000);		// Display error message for 2 seconds
		Quit();
		}
	}
开发者ID:jjturn,项目名称:lb-boards,代码行数:9,代码来源:Example1.cpp


示例15: Vector

void CHostageImprov::__MAKE_VHOOK(OnReset)()
{
	m_moveFlags = 0;
	m_moveType = Stopped;
	m_moveLimit = Running;

	m_vel.x = 0;
	m_vel.y = 0;

	m_actualVel = Vector(0, 0, 0);
	m_checkNearbyTerroristTimer.Invalidate();

	m_lastKnownArea = NULL;
	m_hasKnownGoodPos = false;
	m_hasPriorKnownGoodPos = false;
	m_isTerroristNearby = false;
	m_isCrouching = false;

	SetMoveAngle(m_hostage->pev->angles.y);

	m_moveGoal = m_hostage->m_vStart;

	ClearLookAt();
	ClearFaceTo();

	m_blinkTimer.Invalidate();
	m_blinkCounter = 0;

	m_hostage->SetBoneController(2, 0);
	m_hostage->SetBoneController(3, 0);
	m_hostage->SetBoneController(4, 0);

	m_path.Invalidate();
	m_chatterTimer.Invalidate();

	m_visiblePlayerCount = 0;
	m_isDelayedChatterPending = 0;

	m_animateState.Reset();
	m_didFidget = 0;

	m_lastSawCT.Start();
	m_lastSawT.Start();

	m_scaredTimer.Invalidate();
	m_jumpTimer.Invalidate();
	m_hasJumped = false;

	m_isFriendInTheWay = false;
	m_aggression = RANDOM_FLOAT(0, 1);

	StandUp();
	m_behavior.Reset(this);
	Idle();
}
开发者ID:Solexid,项目名称:ReGameDLL_CS,代码行数:55,代码来源:hostage_improv.cpp


示例16: main

/*-----------------------------------------------------------------------------
*  program start
*/
int main(void) {                      

    int     sioHandle;
    uint8_t windThreshold1;
    uint8_t windThreshold2;

    MCUSR = 0;
    wdt_disable();

    /* get module address from EEPROM */
    sMyAddr = eeprom_read_byte((const uint8_t *)MODUL_ADDRESS);
    windThreshold1 = eeprom_read_byte((const uint8_t *)WIND_THRESHOLD1);
    windThreshold2 = eeprom_read_byte((const uint8_t *)WIND_THRESHOLD2);
    GetClientListFromEeprom();

    PortInit();
    TimerInit();
    SioInit();
    sioHandle = SioOpen("USART0", eSioBaud9600, eSioDataBits8, eSioParityNo, 
                        eSioStopBits1, eSioModeHalfDuplex);
    SioSetIdleFunc(sioHandle, IdleSio);
    SioSetTransceiverPowerDownFunc(sioHandle, BusTransceiverPowerDown);

    BusTransceiverPowerDown(true);
   
    BusInit(sioHandle);
    spRxBusMsg = BusMsgBufGet();

    /* enable global interrupts */
    ENABLE_INT;  

    SendStartupMsg();

    /* wait for controller startup delay for sending first state telegram */
    DELAY_S(STARTUP_DELAY);

    while (1) { 
        Idle();
        ProcessSwitch();
        ProcessBus();
      
        if (sWind >= windThreshold1) {
            sWindSwitch |= 0x01;
        } else {
            sWindSwitch &= ~0x01;    
        }
        if (sWind >= windThreshold2) {
            sWindSwitch |= 0x02;
        } else {
            sWindSwitch &= ~0x02;    
        }    
    }
    return 0;  /* never reached */
}
开发者ID:tpotechnix,项目名称:homebus,代码行数:57,代码来源:main.c


示例17: Blocked

func Blocked(object clonk)
{
	AddEffect("Blocked", this, 1, 1, this);
	Sound("Ball::ball_blocked", false, 20);
	SetRDir(20);
	var objectangle = Angle(clonk->GetX(), clonk->GetY(), GetX(), GetY());
	
	//var tangle = 2* ( (objectangle + 90)%360 - entryangle) + entryangle;
	SetVelocity(objectangle, Speed);
	Idle();
}
开发者ID:TheThow,项目名称:OpenClonk-Stuff,代码行数:11,代码来源:Script.c


示例18: ReadBits

UCHAR ReadBits(void) {
	UCHAR Value;
	DWORD BytesRead;
	FT_Status = FT_Read(FT_Handle, &Value, 1, &BytesRead);
	if (FT_Status != FT_OK) {
		printf("\nFT_Read error (%d), Cable disconnected?\n", FT_Status);
		Idle(2000);		// Display error message for 2 seconds
		Quit();
		}
	return ~Value;
	}
开发者ID:jjturn,项目名称:lb-boards,代码行数:11,代码来源:Example1.cpp


示例19: vApplicationIdleHook

void vApplicationIdleHook(void)
{
    /*
     * **configUSE_IDLE_HOOK must be set to 1**
     * Esta funcion se ejecuta cuando el procesador
     * no esta siendo utilizado por otra tarea
     */

    ClrWdt();
    Idle();
}
开发者ID:spel-uchile,项目名称:SUCHAI,代码行数:11,代码来源:main.c


示例20: BootLine

UcciCommEnum BootLine(void) {
  char szLineStr[SE_LINE_INPUT_MAX_CHAR];
  pipeOpen();
  while (!pipeInputReadLine(szLineStr)) {
    Idle();
  }
  if (StrEqv(szLineStr, "ucci")) {
    return UCCI_COMM_UCCI;
  } else {
    return UCCI_COMM_UNKNOWN;
	}
}
开发者ID:huhuhu1092,项目名称:test-server,代码行数:12,代码来源:ucci.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IdleI2C函数代码示例发布时间:2022-05-30
下一篇:
C++ Identity_check函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap