mirror of https://github.com/thesofproject/sof.git
c15c43e9fe
Several code paths use the existing clock_ms_to_ticks() function in some not ideal ways, potentially leading to computation overhead or to precision loss. The function is often called to calculate ticks for 1 millisecond, which then is recalculated to the required time interval. It's better to let the function calculate the number of ticks for the required time interval directly. E.g. instead of clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1) * milliseconds it's better to call clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, milliseconds) directly. For microseconds however replacing clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1) * microseconds / 1000 with clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, microseconds / 1000) can lead to a loss of precision. To avoid that a new function clock_us_to_ticks() is added. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> |
||
---|---|---|
.. | ||
cmocka | ||
CMakeLists.txt |