From f71135f1f02bd2e2dcfcbd64c91c5e4a392a532a Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Fri, 15 Sep 2017 10:17:32 +0100 Subject: [PATCH] timer: Removed round() That drags libm in, and we don't need that. Signed-off-by: Michel Pollet --- simavr/sim/avr_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simavr/sim/avr_timer.c b/simavr/sim/avr_timer.c index fede329..d430aa2 100644 --- a/simavr/sim/avr_timer.c +++ b/simavr/sim/avr_timer.c @@ -457,7 +457,8 @@ avr_timer_configure( if (prescaler != 0) resulting_clock = p->ext_clock / prescaler; tov_cycles_exact = (float)avr->frequency / p->ext_clock * prescaler * (top+1); - p->tov_cycles = round(tov_cycles_exact); + // p->tov_cycles = round(tov_cycles_exact); -- don't want libm! + p->tov_cycles = tov_cycles_exact + .5f; // Round to integer p->tov_cycles_fract = tov_cycles_exact - p->tov_cycles; } } -- 2.39.5