linreg: fix servo resetting
The stats for the maximum size were not reset, which caused the the servo to reuse old data instead of returning with unlocked state. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>master
parent
7455c24148
commit
37459fd1ad
2
linreg.c
2
linreg.c
|
@ -294,7 +294,7 @@ static void linreg_reset(struct servo *servo)
|
||||||
s->last_update = 0;
|
s->last_update = 0;
|
||||||
s->frequency_ratio = 1.0;
|
s->frequency_ratio = 1.0;
|
||||||
|
|
||||||
for (i = MIN_SIZE; i < MAX_SIZE; i++) {
|
for (i = MIN_SIZE; i <= MAX_SIZE; i++) {
|
||||||
s->results[i - MIN_SIZE].slope = 0.0;
|
s->results[i - MIN_SIZE].slope = 0.0;
|
||||||
s->results[i - MIN_SIZE].err_updates = 0;
|
s->results[i - MIN_SIZE].err_updates = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue