Make pollcat_loop_exit() a oneshot
This commit is contained in:
@@ -95,7 +95,13 @@ struct pollcat *pollcat_iter_next (void);
|
||||
int pollcat_loop (int *poll_ret);
|
||||
|
||||
|
||||
/** Cause pollcat_loop() to return 0 on its next call
|
||||
/** Cause pollcat_loop() to return 0 on its next call only
|
||||
*
|
||||
* \note Each call of pollcat_loop_exit() causes pollcat_loop() to return 0 once;
|
||||
* pollcat_loop() then resets the flag to return nonzero until the next time
|
||||
* pollcat_loop_exit() has been called. This allows the entire main loop to be
|
||||
* wrapped in an outer loop so tasks like updating firmware can be done without
|
||||
* affecting the pollcat loop.
|
||||
*/
|
||||
void pollcat_loop_exit (void);
|
||||
|
||||
|
||||
@@ -132,7 +132,10 @@ int pollcat_loop (int *poll_ret)
|
||||
|
||||
/* check whether pollcat_loop_exit() has been called, and return 0 if so */
|
||||
if ( pollcat_loop_stop )
|
||||
{
|
||||
pollcat_loop_stop = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* call pollcat_timer_reduce_timeout() to improve timer latency */
|
||||
pollcat_timer_reduce_timeout();
|
||||
|
||||
Reference in New Issue
Block a user