static void sub_814395C(void) { RunTasks(); AnimateSprites(); BuildOamBuffer(); UpdatePaletteFade(); if ((gMain.heldKeys & B_BUTTON) && gUnknown_02039324 != 0 && gTasks[gUnknown_02039322].func == task_a_8143B68) { vblank_8143948(); RunTasks(); AnimateSprites(); BuildOamBuffer(); UpdatePaletteFade(); gUnknown_02039325 = 1; } }
int CScheduler::RunTasks(const CLinearTimeAbsolute& ltaNow) { ReadyTasks(ltaNow); if (mudconf.active_q_chunk) { return RunTasks(mudconf.active_q_chunk); } else { return RunAllTasks(); } }
int CScheduler::RunAllTasks(void) { int nTotalTasks = 0; int nTasks; do { nTasks = RunTasks(100); nTotalTasks += nTasks; } while (nTasks); return nTotalTasks; }
int main(void) { InitRTOS(); RunRTOS(); initAll(); wdt_enable(WDTO_120MS); RunTasks(); while (1) { wdt_reset(); // �בנמס סמבאק�ודמ עאילונא TaskManager(); // ��חמג הטסןועקונא } }
static void CB2_StartFirstBattle(void) { UpdatePaletteFade(); RunTasks(); if (IsBattleTransitionDone() == TRUE) { gBattleTypeFlags = BATTLE_TYPE_FIRST_BATTLE; gMain.savedCallback = CB2_EndFirstBattle; SetMainCallback2(sub_800E7C4); RestartWildEncounterImmunitySteps(); ClearPoisonStepCounter(); IncrementGameStat(GAME_STAT_TOTAL_BATTLES); IncrementGameStat(GAME_STAT_WILD_BATTLES); } }
/*lint -save -e970 Disable MISRA rule (6.3) checking. */ int main(void) /*lint -restore Enable MISRA rule (6.3) checking. */ { /* Write your local variable definition here */ /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ /* Write your code here */ /* For example: for(;;) { } */ RunTasks(); /*** Don't write any code pass this line, or it will be deleted during code generation. ***/ /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/ #ifdef PEX_RTOS_START PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */ #endif /*** End of RTOS startup code. ***/ /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/ for(;;){} /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
int main(int argc, char* argv[]) { auto taskGenerator = []() { return []() { double r = 3.1; double x = 0.6; for (int i = 0; i < 10000; ++i) { x = r * x * (1.0 - x); } if (x > 5) { std::cout << "FAIL" << std::endl; } }; }; std::cout << "Logistic map" << std::endl; RunTasks(10000, taskGenerator); auto streamTaskGenerator = []() { return []() { std::stringstream ss; ss << 5 << 7 << "Hello" << 4.6 << -0.1; if (ss.str() == "Nicaragua") { std::cout << "FAIL" << std::endl; } }; }; std::cout << "build string with stringstream" << std::endl; RunTasks(100000, streamTaskGenerator); auto toStringTaskGenerator = []() { return []() { auto s = std::to_string(66.6); if (s == "Nicaragua") { std::cout << "FAIL" << std::endl; } }; }; std::cout << "build string with to_string" << std::endl; RunTasks(100000, streamTaskGenerator); std::mutex m; auto mutexTaskGenerator = [&m]() { return [&m]() { std::lock_guard<std::mutex> l(m); }; }; std::cout << "mutex lock" << std::endl; RunTasks(100000, mutexTaskGenerator); }