projects
/
sx
/
simavr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
regExp
home
|
summary
|
tags
|
heads
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
raw
|
patch
| inline |
side by side
(parent:
6466529
)
Commit
f71135f1f02bd2e2dcfcbd64c91c5e4a392a532a
author
Michel Pollet
<buserror@gmail.com>
Fri, 15 Sep 2017 09:17:32 +0000
(10:17 +0100)
committer
Michel Pollet
<buserror@gmail.com>
Fri, 15 Sep 2017 09:17:32 +0000
(10:17 +0100)
That drags libm in, and we don't need that.
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_timer.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_timer.c
b/simavr/sim/avr_timer.c
index fede329aff0bc9d6d88da03c3362f511c26af20f..d430aa2d05db61df225fc8ba040c0fbf387e0bec 100644
(file)
--- 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;
}
}