Could some kind person give me a code snippet showing a typical use of os_tmr_create, _kill and _call.
I can't get my head around as to how these should be used and what they can be used for. I have them sort of working but seem to get multiple instances of timers which seems wrong. Right now I just want to be able to periodically run a function, and os_tmr looks like what I should be using.
As a more general are there any larger code examples of using the RTX, I mean more complex than the Keil examples, ie. perhaps a teaching book or something. To help me move forward with more confidence.
Thanks for the guideline, I was guilty of your gotcha #1).
It seems it's not possible to use os_tmr_create inside a __task's while(1) { ..etc.. }. I tried testing for tmr1 == NULL before using os_tmr_create too, but that doesn't work. Perhaps I need to use a semaphore?
I did try putting the os_tmr_create in the os_tmr_call function (to restart a timer when it timed out). This seems to work, but there is a note. That seems to indicate that I cannot do it this way.
quote You can call any of the isr_ system functions from the os_tmr_call function, but you cannot call any of the os_ system functions. unquote
I would really appreciate a code fragment as guidance.