Hi,
I'm using SEM_pendBinary
and I want to provide a timeout appropriate to the semaphore's function. The documentation states that the timeout is based on system clock ticks.
My first mistake was thinking that system clock ticks were DSP clock ticks.
I now believe my system clock tick is configured by the 'Microseconds/Int' value on the CLK General tab (or bios.CLK.MICROSECONDS = 999.9960
). In other words the system clock tick is approximately 1 ms. (My configuration is based on the DSK6455 platform.)
I want to write something like:
const Uns timeoutInMicroseconds = 1000u;
const Uns timeoutInTicks = timeoutInMicroseconds / SYSTEM_CLOCK_PERIOD;
SEM_pend(&sem, timeoutInTicks);
I've been reading about CLK_getprd()
, CLK_countspms()
, etc. but after an hour I'm still not sure what to do with them and anyway, they are functions and I'd quite like a constant.
Any thoughts greatly appreciated.
Thanks,
Matt