/** * @brief This function implements the idle thread infinite loop. * @details The function puts the processor in the lowest power mode capable * to serve interrupts.<br> * The priority is internally set to the minimum system value so * that this thread is executed only if there are no other ready * threads in the system. * * @param[in] p the thread parameter, unused in this scenario */ void _idle_thread(void *p) { (void)p; while (TRUE) { port_wait_for_interrupt(); IDLE_LOOP_HOOK(); } }
/** * @brief This function implements the idle thread infinite loop. * @details The function puts the processor in the lowest power mode capable * to serve interrupts.<br> * The priority is internally set to the minimum system value so * that this thread is executed only if there are no other ready * threads in the system. * * @param[in] p the thread parameter, unused in this scenario */ void _idle_thread(void *p) { (void)p; chRegSetThreadName("idle"); while (TRUE) { port_wait_for_interrupt(); IDLE_LOOP_HOOK(); } }
/** * @brief This function implements the idle thread infinite loop. * @details The function puts the processor in the lowest power mode capable * to serve interrupts.<br> * The priority is internally set to the minimum system value so * that this thread is executed only if there are no other ready * threads in the system. * * @param[in] p the thread parameter, unused in this scenario */ static void _idle_thread(void *p) { (void)p; chRegSetThreadName("idle"); while (true) { port_wait_for_interrupt(); CH_CFG_IDLE_LOOP_HOOK(); } }
/** * @brief This function implements the idle thread infinite loop. * @details The function puts the processor in the lowest power mode capable * to serve interrupts.<br> * The priority is internally set to the minimum system value so * that this thread is executed only if there are no other ready * threads in the system. * * @param[in] p the thread parameter, unused in this scenario */ static void _idle_thread(void *p) { (void)p; chRegSetThreadName("idle"); while (true) { /*lint -save -e522 [2.2] Apparently no side effects because it contains an asm instruction.*/ port_wait_for_interrupt(); /*lint -restore*/ CH_CFG_IDLE_LOOP_HOOK(); } }
static void halt() { port_disable(); while(true) { port_wait_for_interrupt(); } }