Le mardi, 1 oct 2002, � 16:24 Europe/Paris, Dan a �crit : > I'm trying to implement a delay of 0.5 milliseconds in my code, > however the > Palm OS System tick functions can only gives me a resolution of 0.01 > second > for each tick. Is there any other way that I can achieve that? such as > inserting NOP in assembly code??
Le mardi, 1 oct 2002, � 16:49 Europe/Paris, Dave Lippincott a �crit : > More like 0.016666666 (1/60) > There are methods, although I think all involve working directly with > the > processor. There have been several post in the past, you could search > the > forum archive. In fact, you should not rely on ticks been updated every 1/100 or 1/60 ( I think POSE use the later ), but use SysTicksPerSecond() to get the exact value used on the device your code is running. As dave mentionned it, I remember someone posted an interresting exemple of a millisecond timer. If you don't find it, you can use the ( simple ) following principle : - do a loop doing some stuff that last exactly 1 second. - divide the number of time your loop was running by 200 to get a 5 ms delay Of course, this need some tuning to work correctly, but the principle should work. -- Daniel Morais http://www.kickoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
