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

C++ idle函数代码示例

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

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



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

示例1: onEnter

void NOD_Idle::onEnter( const BTInputParam &input )
{
	const BlackBoard &inputData = input.getRealData<BlackBoard>();

	auto self = inputData.self;

	self->idle();
	this->finish();
	/*
	self->runAction(Sequence::create(DelayTime::create(1.0f), CallFunc::create([=]() {
		this->finish();
	}), nullptr));
	*/
}
开发者ID:RayRiver,项目名称:LinkWar,代码行数:14,代码来源:NOD_Idle.cpp


示例2: main

int main(int argc, char *argv[])
{
    
    init();
    
    glfwInit();
    
    window = glfwCreateWindow(1024, 1024, "OpenGL", nullptr, nullptr); // Windowed
    glfwMakeContextCurrent(window);
    glfwSwapInterval(1);
	glClearColor(0.8f, 0.8f, 0.8f, 0.8f);
    while(!glfwWindowShouldClose(window)){
        
        float ratio;
        int width, height;
       
        glfwGetFramebufferSize(window, &width, &height);
        ratio = width / (float) height;
        
        glViewport(0, 0, width, height);
        glClear(GL_COLOR_BUFFER_BIT);
        
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();

        glOrtho(-50.0, 562.0, -50.0, 562.0, -1, 1);
        
        box.DrawBox(show_grid);
		drawText();
        calculateAcceleration();
        handleInputs();
        display();
        idle();
        
        //Swap front and back buffers
        glfwSetWindowSizeCallback(window, reshape_window);
        glfwSwapBuffers(window);
        
        //Poll for and process events
        glfwPollEvents();
        
    }
    
    
    glfwDestroyWindow(window);
    glfwTerminate();
    
    return EXIT_SUCCESS;
    
}
开发者ID:novalain,项目名称:Modelleringsprojekt,代码行数:50,代码来源:main.cpp


示例3: time_expired

// seg001:04D3
void __pascal far time_expired() {
	disable_keys = 1;
	set_hourglass_state(7);
	hourglass_sandflow = -1;
	play_sound(sound_36_out_of_time); // time over
	if (fade_in_1()) return;
	if (proc_cutscene_frame(2)) return;
	if (proc_cutscene_frame(100)) return;
	fade_out_1();
	while (check_sound_playing()) {
		idle();
		do_paused();
	}
}
开发者ID:ecalot,项目名称:SDLPoP,代码行数:15,代码来源:seg001.c


示例4: while

int32_t Engine::run() {
    is_running_ = true;

    while(is_running_) {
        chapter_manager().current_chapter().frame_start();
        is_running_ = window().update();
        chapter_manager().current_chapter().frame_finish();

        idle().execute();
        timed().execute();
    }

    return 0;
}
开发者ID:Kazade,项目名称:K4X,代码行数:14,代码来源:engine.cpp


示例5: while

int win32_windowed_app::run() {
    MSG msg = { 0 };
    msg.message = WM_NULL;
    while (msg.message != WM_QUIT) {
        if (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE) != 0) {
            ::TranslateMessage(&msg);
            ::DispatchMessage(&msg);
        }
        else {
            idle();
        }
    }
    return msg.wParam;
}
开发者ID:jseward,项目名称:solar,代码行数:14,代码来源:win32_windowed_app.cpp


示例6: orientPlayer

list<Entity*> OverheadPlayer::update(float diff)
{
    list<Entity*> result;

    orientPlayer();

    Entity::update(diff);

    cooldown -= diff;
    if(cooldown<0) cooldown = 0;

    bool xflag = false;
    bool yflag = false;

    if(Keyboard::isKeyPressed(application->controls.getKey("Move Up")))
    {
        yflag = true;
        accelerateCenter(b2Vec2(0, -5.f));
    }
    if(Keyboard::isKeyPressed(application->controls.getKey("Move Down")))
    {
        yflag = true;
        accelerateCenter(b2Vec2(0, 5.f));
    }
    if(Keyboard::isKeyPressed(application->controls.getKey("Move Right")))
    {
        xflag = true;
        accelerateCenter(b2Vec2(5.f, 0.f));
    }
    if(Keyboard::isKeyPressed(application->controls.getKey("Move Left")))
    {
        accelerateCenter(b2Vec2(-5.f, 0.f));
        xflag = true;
    }
    if(Mouse::isButtonPressed(application->controls.getMouseButton("Shoot")))
    {
        if(cooldown==0)
            result.push_back(shoot());
    }

    if(!xflag && !yflag)
    {
        idle();
    }

    if(!xflag) decelerateX();
    if(!yflag) decelerateY();

    return result;
}
开发者ID:Kiterosma,项目名称:AlienSpaceOdyssey,代码行数:50,代码来源:overheadPlayer.cpp


示例7: rsid_test

/**
 * RSID function for use during testing. Not for flight
 */
void rsid_test(void)
{
  while (1) {

   telemetry_start_rsid(RSID_CONTESTIA_32_1000);

   // Sleep wait for RSID
   while (telemetry_active()) {
     idle(IDLE_TELEMETRY_ACTIVE);
   }

    for (int i = 3*200*1000; i; i--);
  }
}
开发者ID:bristol-seds,项目名称:pico-tracker,代码行数:17,代码来源:rf_tests.c


示例8: suspend_power_down

void suspend_power_down(void)
{
#ifdef NO_SUSPEND_POWER_DOWN
    ;
#elif defined(SUSPEND_MODE_NOPOWERSAVE)
    ;
#elif defined(SUSPEND_MODE_STANDBY)
    standby();
#elif defined(SUSPEND_MODE_IDLE)
    idle();
#else
    power_down(WDTO_15MS);
#endif
}
开发者ID:Eleuin,项目名称:tmk_keyboard,代码行数:14,代码来源:suspend.c


示例9: move

void MadsPlayer::nextFrame() {
	if (_madsVm->_currentTimer >= (_priorTimer + _ticksAmount)) {
		_priorTimer = _madsVm->_currentTimer;

		if (_moving)
			move();
		else
			idle();

		// Post update logic
		if (_moving) {
			++_frameNum;
			if (_frameNum > _frameCount)
				_frameNum = 1;
			_forceRefresh = true;
		} else if (!_forceRefresh) {
			idle();
		}

		// Final update
		update();
	}
}
开发者ID:peres,项目名称:scummvm,代码行数:23,代码来源:mads_player.cpp


示例10: delay

////////////////////////////////////////////////////////////////////////////////
// delay
// PURPOSE: Blocks for a given number of seconds.
// PARAMS:  (IN) int time - number of seconds to delay.
// RETURNS: Nothing.
// NOTES:   Unreliable before init_timer is run.
////////////////////////////////////////////////////////////////////////////////
void
delay(int time){
  u32 now = 0;
 
  now = get_time_timer();
  while(time--)
  {
    while(now == get_time_timer())
    {
       idle();
    }
    now = get_time_timer();
  }
}
开发者ID:xatier,项目名称:i-boot-review,代码行数:21,代码来源:timer_xscale.c


示例11: cpu_idle

void cpu_idle (void)
{
	
	while (1) {
		while (!need_resched()) {
			void (*idle)(void);
			idle = pm_idle;
			if (!idle)
				idle = default_idle;
			idle();
		}
		schedule_preempt_disabled();
	}
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:14,代码来源:process.c


示例12: readBytes

void DW1000Class::softReset() {
	byte pmscctrl0[LEN_PMSC_CTRL0];
	readBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
	pmscctrl0[0] = 0x01;
	writeBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
	pmscctrl0[3] = 0x00;
	writeBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
	delay(10);
	pmscctrl0[0] = 0x00;
	pmscctrl0[3] = 0xF0;
	writeBytes(PMSC, PMSC_CTRL0_SUB, pmscctrl0, LEN_PMSC_CTRL0);
	// force into idle mode
	idle();
}
开发者ID:muhammadyaseen,项目名称:arduino-dw1000,代码行数:14,代码来源:DW1000.cpp


示例13: sys_exit

s32 sys_exit()
{
    u32 eflags;

    _local_irq_save(eflags);
    if (task_list[current].pwait != 0) 
        task_wakeup(task_list[current].pwait);

    task_list[current].state = TASK_STOPED;
    _local_irq_restore(eflags);

    /* 等待0号任务清空 */
    while(1){idle();};
}
开发者ID:liexusong,项目名称:tinixdev,代码行数:14,代码来源:sys_exit.c


示例14: keyboard

/* ARGSUSED1 */
void
keyboard(unsigned char ch, int x, int y)
{
  switch (ch) {
  case 27:             /* escape */
    exit(0);
    break;
  case ' ':
    if (!moving) {
      idle();
      glutPostRedisplay();
    }
  }
}
开发者ID:kallisti5,项目名称:sgi_gldemos,代码行数:15,代码来源:moth.c


示例15: ftDigital

unsigned char ftDigital (unsigned short port) {
  unsigned char result = 0;
#ifdef _WIN32
  unsigned short status = port+1;
  int enabled = ftDisable && _disable();
#endif
#ifdef SC12
  unsigned short status = port;
#endif
  int bit = 8;
  int data = triggerX|triggerY|loadIn;
  if (ftLoadOut) data |= loadOut;
  
  trace(8, ("digital %03x", port));
  trace(32, (" >%02x", data));
  _outp(port, data); idle(ftIdle);
  data |= clock;
  trace(32, (" >%02x", data));
  _outp(port, data);
  while (bit-- > 0) {
    idle(ftIdle);
    result |= ((_inp(status) & busy) != 0) << bit;
    trace(16, (" <%02x", result));
    data = triggerX|triggerY;
    if (ftLoadOut) data |= loadOut;
    trace(32, (" >%02x", data));
    _outp(port, data); idle(ftIdle);
    data |= clock;
    trace(32, (" >%02x", data));
    _outp(port, data);
  }
  trace(8, (" %02x\n", result));
#ifdef _WIN32
  if (enabled) _enable();
#endif
  return result;
}
开发者ID:takashiyamanoue,项目名称:SolarCats,代码行数:37,代码来源:parallel.c


示例16: assert

bool SignalHandler::waitForEvent(pdvector<EventRecord> &events_to_handle)
{
    assert(waitLock);

    signal_printf("%s[%d]: waitForEvent, events_to_handle(%d), idle_flag %d\n",
                  FILE__, __LINE__, events_to_handle.size(), idle());

    while (idle()) {
        // Our eventlocks are paired mutexes and condition variables; this
        // is actually _not_ what we want because we want to be able to
        // wait on different things but have the same global mutex. So we fake it
        // by carefully unlocking and relocking things. 
        
        // We now wait until _we_ are signalled by the generator; so we grab
        // our signal lock, give up the global mutex lock, and then wait; after
        // we're signalled we take the global mutex before giving up our own 
        // waitLock.
        
        waitingForWakeup_ = true;
        signal_printf("%s[%d]: acquiring waitLock lock...\n", FILE__, __LINE__);
        waitLock->_Lock(FILE__, __LINE__);
        signal_printf("%s[%d]: releasing global mutex...\n", FILE__, __LINE__);
        assert(eventlock->depth() == 1);
        eventlock->_Unlock(FILE__, __LINE__);
        
        signal_printf("%s[%d]: sleeping for activation\n", FILE__, __LINE__);
        waitLock->_WaitForSignal(FILE__, __LINE__);
        
        signal_printf("%s[%d]: woken, reacquiring global lock...\n", FILE__, __LINE__);
        eventlock->_Lock(FILE__, __LINE__);
        signal_printf("%s[%d]: woken, releasing waitLock...\n", FILE__, __LINE__);
        waitLock->_Unlock(FILE__, __LINE__);
        waitingForWakeup_ = false;        
    }
    
    return true;
}
开发者ID:vishalmistry,项目名称:imitate,代码行数:37,代码来源:signalhandler.C


示例17: USO_transform

extern void
USO_transform (void (*run) (void), USO_stack_t * stack, int stack_size)
{
    USO_list_init (&interrupt_threads);
    USO_list_init (&system_threads);
    USO_list_init (&user_threads);
    USO_thread_init (&idle_thread, NULL, stack, stack_size, USO_IDLE, USO_FIFO, "idle");
    USO_thread_in_init (&idle_thread, NULL);
    USO_thread_out_init (&idle_thread, NULL);
    USO_thread_work_set (&idle_thread, NULL);
    current_thread = &idle_thread;
    old_thread = &idle_thread;
    run ();
    idle ();
}
开发者ID:BackupTheBerlios,项目名称:most,代码行数:15,代码来源:scheduler.c


示例18: cpu_idle

/*
 * The idle thread. There's no useful work to be
 * done, so just try to conserve power and have a
 * low exit latency (ie sit in a loop waiting for
 * somebody to say that they'd like to reschedule)
 */
void cpu_idle (void)
{
	/* endless idle loop with no priority at all */
	while (1) {
		while (!need_resched()) {
			void (*idle)(void) = pm_idle;

			if (!idle)
				idle = default_idle;

			idle();
		}
		schedule_preempt_disabled();
	}
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:21,代码来源:process.c


示例19: modbus_update

// Modbus Master State Machine
void modbus_update() 
{
	switch (state)
	{
		case IDLE:
		idle();
		break;
		case WAITING_FOR_REPLY:
		waiting_for_reply();
		break;
		case WAITING_FOR_TURNAROUND:
		waiting_for_turnaround();
		break;
	}
}
开发者ID:ElJUaNKeR,项目名称:simple-modbus,代码行数:16,代码来源:SimpleModbusMaster.cpp


示例20: psdapl_recvlook_block

static inline
int psdapl_recvlook_block(psdapl_con_info_t *ci, void **buf)
{
	int len;
	while (1) {
		len = psdapl_recvlook(ci, buf);
		if (len >= 0) return len;

		if (len != -EAGAIN) {
			printf("receive returned an error : %s\n", strerror(-len));
			exit(1);
		}
		idle();
	}
}
开发者ID:JonBau,项目名称:pscom,代码行数:15,代码来源:dapl_pp.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ idle_cpu函数代码示例发布时间:2022-05-30
下一篇:
C++ idl_fileCur函数代码示例发布时间: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