diff --git a/src/drv/rts-logger/module/rts-logger.c b/src/drv/rts-logger/module/rts-logger.c index da2d52cfda4c58b27b872af89c21b78a079fc57b..49280fbe8b429a50b17975617a27ee98b672a741 100644 --- a/src/drv/rts-logger/module/rts-logger.c +++ b/src/drv/rts-logger/module/rts-logger.c @@ -160,7 +160,7 @@ int printer_thread_fn( void * pv ) { //If num filled is ready but ready_for_print is not, we are waiting for - //the vsnprintf to complete + //the vsnprintf to complete, which will be fast if(ready_for_print[next_to_print] == 0) { schedule(); @@ -181,9 +181,12 @@ int printer_thread_fn( void * pv ) } num_read = 0; - //If there are no mesages ready for printing, we can give up the CPU + // If there are no mesages ready for printing, we can give up the CPU + // for a while if( atomic_read(&g_num_filled) == 0) - usleep_range(499, 1000); + usleep_range(1000, 2500); + else //We have more messages + schedule(); } return 0; }