fixed a bug in interval time updating
This commit is contained in:
parent
681b8998c2
commit
c306fea426
1 changed files with 2 additions and 2 deletions
|
@ -219,7 +219,7 @@ void statusloop()
|
||||||
}
|
}
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
int interrupted = 0;
|
int interrupted = 0;
|
||||||
struct timespec sleeptime = {interval, 0};
|
const struct timespec sleeptime = {interval, 0};
|
||||||
struct timespec tosleep = sleeptime;
|
struct timespec tosleep = sleeptime;
|
||||||
getcmds(-1);
|
getcmds(-1);
|
||||||
while(statusContinue)
|
while(statusContinue)
|
||||||
|
@ -234,7 +234,7 @@ void statusloop()
|
||||||
getcmds(i);
|
getcmds(i);
|
||||||
writestatus();
|
writestatus();
|
||||||
// then increment since its actually been a second (plus the time it took the commands to run)
|
// then increment since its actually been a second (plus the time it took the commands to run)
|
||||||
i++;
|
i += interval;
|
||||||
// set the time to sleep back to the sleeptime of 1s
|
// set the time to sleep back to the sleeptime of 1s
|
||||||
tosleep = sleeptime;
|
tosleep = sleeptime;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue