projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
932f153
)
Fix cc_period_make to not get stuck on samples with matching time
author
Keith Packard
<keithp@keithp.com>
Mon, 7 Sep 2009 04:01:44 +0000
(21:01 -0700)
committer
Keith Packard
<keithp@keithp.com>
Mon, 7 Sep 2009 04:01:44 +0000
(21:01 -0700)
When two samples have matching times, step to the second one;
otherwise, we'll get stuck forever.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao-tools/lib/cc-period.c
patch
|
blob
|
history
diff --git
a/ao-tools/lib/cc-period.c
b/ao-tools/lib/cc-period.c
index 2a4e59521907a36d621199c2e1a6a6e19d5f8072..844ac79e9fd35c9333a3053a177b8531719e1116 100644
(file)
--- a/
ao-tools/lib/cc-period.c
+++ b/
ao-tools/lib/cc-period.c
@@
-35,7
+35,7
@@
cc_period_make(struct cc_timedata *td, double start_time, double stop_time)
j = 0;
for (i = 0; i < pd->num; i++) {
t = start_time + i * pd->step;
- while (j < td->num - 1 && fabs(t - td->data[j].time) > fabs(t - td->data[j+1].time))
+ while (j < td->num - 1 && fabs(t - td->data[j].time) >
=
fabs(t - td->data[j+1].time))
j++;
pd->data[i] = td->data[j].value;
}