sof/test/cmocka
Guennadi Liakhovetski c15c43e9fe clock: add a function to convert microseconds to ticks
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>
2021-05-24 11:17:22 +01:00
..
include cleanup: remove double blanks lines. 2021-04-12 16:58:51 +01:00
src clock: add a function to convert microseconds to ticks 2021-05-24 11:17:22 +01:00
CMakeLists.txt cmocka: add support to build mocks on xtensa GCC 2021-04-20 15:35:18 +01:00
cmocka-host-gcc-toolchain.cmake cmocka: add support to run mocks on host architecture 2021-04-20 15:35:18 +01:00
cmocka-xtensa-gcc-toolchain.cmake cmocka: add support to build mocks on xtensa GCC 2021-04-20 15:35:18 +01:00
cmocka-xtensa-xt-toolchain.cmake cmake: xtensa: use absolute paths for tools 2019-06-05 11:38:23 +02:00
memory_mock.x.in alloc: Define new memory zone, shared 2020-10-21 14:57:09 +01:00