I have a single 32-bit 1msec global timer (gulCurrentTime++) that I'd like to use for all timekeeping/scheduling.
In the timer's ISR I would check to see if it matches the alarm time. If it does, a call to TimeDispatch() occurs (gulAlarmTime == gulCurrentTime ) . In TimeDispatch, I would save the global time into ulLastDispatchTime, and use it for any calls made to getElapsedTime (gulCurrentTime - ulLastDispatchTime). So therefore setAlarm would be the only function used to trigger the next timer.c's TimeDispatch event. The problem is, 1) Inside TimeDispatch uses setTimer, not setAlarm (total_sleep_time = next_wakeup). What would be the consequence of changing that to simply set the AlarmTime to be next_wakeup? 2) How should DelAlarm be handled? If I make gulAlarmTime to be less than gulCurrentTime, this will effectively disable TimeDispatch from ever being called again.. is that the way it should work?
_______________________________________________ Canfestival-devel mailing list Canfestival-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/canfestival-devel