If I setup a interval wait timer for 100 clock ticks ,os_itv_set(100), and the execution from the os_itv_set(100) to the os_itv_wait() takes longer than 100 clock ticks, the os_itv_wait() waits for 65535 clock ticks. Is there a way that I can check the clock ticks remaining prior to calling os_itv_wait()?
#include <ARTX.h> void task1 (void) __task { . . os_itv_set (100); for (;;) { . . /* execution may take longer than 100 clock ticks */ os_itv_wait (); /* if 100 clock ticks have passed */ /* this will wait for 65535 clock */ /* ticks. */ } }
Thank you for pointing it out. We have missed it when porting the Kernel from 16-bit platform to 32-bit arm platform. This problem will be fixed in the next version. However you may still access the system tick counter as os_time. It counts the system clock ticks and is declared as:
extern U16 os_time;
Thanks for the quick response. I hadn't thought of using os_time.