【app_usb_aud_xk_216_mc】“thread_speed()” problem? Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
zhengyang0512
Member++
Posts: 27
Joined: Tue Aug 23, 2016 6:14 am

【app_usb_aud_xk_216_mc】“thread_speed()” problem?

Post by zhengyang0512 »

In module_usb_audio, main.xc, I have seen the following code

Code: Select all

void thread_speed()
{
#ifdef FAST_MODE
#warning Building with fast mode enabled
    set_thread_fast_mode_on();
#else
    set_thread_fast_mode_off();
#endif
}
But I don't understand the meaning of it. Please help me, thank you!
View Solution
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

The set_thread_fast_mode_on() function puts a core into fast mode where it never sleeps, even when there is nothing for it to do. This means that it responds more quickly to events but consumes more power as a result. The latency is reduced by a best-case of 16ns, but will typically be less than that. The USB audio code can be compiled with the cores all running in fast mode or not, depending on whether FAST_MODE has been defined. Using FAST_MODE is not the default behaviour, and has therefore not been tested in the same way as it has been with it off. This is why there is a warning if you enable it.