Hi.
We are trying to wrap the SYS/BIOS Clock API with our own abstraction. One of the abstraction functions is a "is the timer still running" query. Now I could implement a "state" variable inside the abstraction, set it to "running" when I start the Clock and set it to "stopped" when the Clock timer expires. However, I was hoping that I could get the Clock to tell me instead.
So, I wrote a test program which starts a Clock and then periodically calls Clock_getTimeout() in the hope that while the Clock is running, the result would be non-zero and then after the Clock timer expires, the value returned by Clock_getTimeout() would be zero.
Unfortunately, after the Clock timer expires, the value returned by Clock_getTimeout() seems to be reset back to the original timeout value (even though I set the Clock up as a "oneshot" one). This is most unhelpful.
Am I doing something wrong ?
Has anyone any handy hints as to how I can implement this without using an abstraction state variable ?
Output from my test program:
---- snip snip ----
[C66xx_1] mainTaskFunc: enter
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 100
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 89
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 78
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 67
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 56
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 45
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 34
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 23
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 12
[C66xx_1] mainTaskFunc: Clock_getTimeout() = 1
[C66xx_1] mainTaskFunc: after timer func called, Clock_getTimeout() = 100
[C66xx_1] mainTaskFunc: leave
[C66xx_1] myIdleFunc: calling BIOS_exit(0)
---- snip snip ----
and test program:
---- snip snip ----
---- snip snip ----
and (finally) the RTSC config:
---- snip snip ----
---- snip snip ----
Thanks for reading this far !
Graham.