I am really surprised that with the latest version of RTX that Keil has changed the functionality of the millisecond parameter to delay functions.
See
http://www.keil.com/support/docs/3766.htm
It sees that now the delay parameter is having 1 added to it in the latest version of RTX.
This is a significant functional change that I would have thought would not have been implemented without reaching out to the community of users. This change breaks a ton of existing code that relies on polling intervals of the tick frequency.
I regularly have threads that implement a 1 ms polling of hardware devices. This is implemented as a simple delay of 1 ms. Granted the first call to this delay function may return in less than 1 ms, but after that it is consistently 1 ms in duration. With the changes I don't believe that I will be able to poll at the tick frequency of 1 ms, it would be 2 ms. It seems to me that minimum polling time has been decreased to 2 times the tick frequency with the latest version.
I would strongly encourage KEIL to put back the original functionality, but I was wondering if others had the same concern.
It seems Keil provided a simple work around in the original support ticket for the user to add 1 to the delay parameter if they wished for a minimum number of millisecond delay. Actually, I wouldn't call this a work around, I would call it simply explaining how an os delay function works. This is exactly what I do when I need minimum delay.
I use 1ms delay many places in my code, with the understanding that the first time through it may be less than 1ms, which is acceptable for my application. But now, Keil has made a change to RTX making it impossible to set a delay of 1ms. Also, now all the delays that I’ve added 1 to achieve a minimum delay will delay an additional millisecond, which I don’t want.
What isn't safe about using a 1ms delay? The os change was brought about by a user using a 1ms delay. If you assume that the first call to the delay function will delay exactly 1ms, then that is simply incorrect because that is not how delay functions work (at least in the older version).
I cannot take this new version of RTX. I hope Keil will revert this change and simply explain how users can achieve a minimum number of millisecond delay if required. I hope the examples above showing how multiple calls to osDelay do not accumulate time correctly will be justification enough for Keil to revert this change.