} tTimer;
// === PROTOTYPES ===
-Sint64 now(void);
void Timer_CallTimers(void);
// === GLOBALS ===
-Uint64 giTicks = 0;
-Sint64 giTimestamp = 0;
-Uint64 giPartMiliseconds = 0;
+volatile Uint64 giTicks = 0;
+volatile Sint64 giTimestamp = 0;
+volatile Uint64 giPartMiliseconds = 0;
tTimer gTimers[NUM_TIMERS]; // TODO: Replace by a ring-list timer
// === CODE ===
-/**
- * \fn Sint64 now()
- * \brief Return the current timestamp
- */
-Sint64 now(void)
-{
- return giTimestamp;
-}
-
/**
* \fn void Timer_CallTimers()
*/
*/
void Time_Delay(int Delay)
{
- Sint64 dest = giTimestamp + Delay;
- while(dest > giTimestamp) Threads_Yield();
+ tTime dest = now() + Delay;
+ while(dest > now()) Threads_Yield();
}
// === EXPORTS ===
-EXPORT(now);
EXPORT(Time_CreateTimer);
EXPORT(Time_RemoveTimer);
EXPORT(Time_Delay);