mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Initialized next and set frequency to right value
This commit is contained in:
parent
c2ee43b01e
commit
36c3161fa8
1 changed files with 3 additions and 2 deletions
|
@ -73,7 +73,6 @@ int task_set_next(struct task *t, struct timespec *next)
|
|||
{
|
||||
|
||||
#if PERIODIC_TASK_IMPL == RDTSC
|
||||
|
||||
#else
|
||||
t->next = *next;
|
||||
|
||||
|
@ -97,7 +96,8 @@ int task_set_rate(struct task *t, double rate)
|
|||
{
|
||||
|
||||
#if PERIODIC_TASK_IMPL == RDTSC
|
||||
t->period = t->frequency / rate;
|
||||
t->period = t->frequency / rate * 1000;
|
||||
t->next = rdtscp() + t->period;
|
||||
#else
|
||||
/* A rate of 0 will disarm the timer */
|
||||
t->period = rate ? time_from_double(1.0 / rate) : (struct timespec) { 0, 0 };
|
||||
|
@ -192,6 +192,7 @@ uint64_t task_wait(struct task *t)
|
|||
now = rdtscp();
|
||||
} while (now < t->next);
|
||||
|
||||
|
||||
for (runs = 0; t->next < now; runs++)
|
||||
t->next += t->period;
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue