Quote:
Originally Posted by Inverted
Okay, I believe I understand your coding, I just want to make sure. If I put in the last snippet of code somewhere in the program, will I be able to call the Sleep function the way I do in InteractiveC as seen in my second example?
If not, then do I put my actions inside the while (TimerSleep); ?
|
Overall, I'm recommending that you do not construct your code to use a sleep() type of programming approach because of the potential negative implications in doing so, but none the less provided the pointer on how to impliment it if you chose to go down that path. If you aren't comfortable setting up a hardware timer and writing an interrupt service routine to handle timers in the background, then this probably isn't a path you should pursue if this is something you need to have working in the next 24 hours.
I'm also not familar with InteractiveC nor was I able to find documentation that seemed to be directly relevant. A quick search of CD for 'InteractiveC' turned up one other post from 2002, so Im unclear on exactly what it is you are using.
One document I did find leads me to believe that it would have its own function libraries, and provides some level of multi-tasking. I saw a reference to a msleep() function which will sleep for the specified number of milli-seconds, but I'm not sure if what you are using also has this function included.
Whenever you have a multi-tasking in use, it is normal for any user written interrupt service routines to call O/S interrupt entry and exit functions to save additional registers or memory that the O/S may need to protect.
...anyway, if you can provide a URL pointer to the documentation I'd be glad to look at it and comment further, but right now I'm really hesitant to provide any advice because it may or may not be valid advice for your development environment.