From d2f97f27451ecb2a9a38ec95c27ffe3cde260651 Mon Sep 17 00:00:00 2001 From: Glenn Elliott Date: Mon, 29 Nov 2010 16:13:07 -0500 Subject: Bugfix: use fabs() instead of abs() The triangular waveform in rtspin.c used integer's abs() instead of floating-point's fabs(). This resulted in incorrect waveforms. --- bin/rtspin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rtspin.c b/bin/rtspin.c index 939d507..0995d01 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c @@ -186,7 +186,7 @@ double tri_wave(int count, struct wave_data* w) { double step = count % w->period; double v = 2.0 * (step/w->period - floor(step/w->period + 0.5)); - double exe = w->min_wcet_ms + w->amplitude * abs(v); + double exe = w->min_wcet_ms + w->amplitude * fabs(v); return(exe); } -- cgit v1.2.2