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:
75d4e07
)
Commit
9090a5c3a0520ed3f82f9028769d74fed6febccd
author
Tibor Peluch
<messani@gmail.com>
Thu, 1 Sep 2016 19:43:52 +0000
(21:43 +0200)
committer
Tibor Peluch
<messani@gmail.com>
Thu, 1 Sep 2016 19:43:52 +0000
(21:43 +0200)
simavr/sim/avr_timer.c
patch
|
blob
|
history
|
download
diff --git
a/simavr/sim/avr_timer.c
b/simavr/sim/avr_timer.c
index b1de9bd4ff830db90b47086002c9dae27559902d..dba4e9bc0a36b9a60f0f6163b8cd7f439ffa4e77 100644
(file)
--- a/
simavr/sim/avr_timer.c
+++ b/
simavr/sim/avr_timer.c
@@
-462,7
+462,7
@@
avr_timer_write(
// to be synced. To obtain better simulation results
// p->tov_base type must be float or avr->frequency
// must be multiple of 32768.
- p->cs_div_clock =
avr->frequency / 32768
;
+ p->cs_div_clock =
(uint32_t)((float)avr->frequency * (1 << p->cs_div[new_cs]) / 32768)
;
} else {
p->cs_div_clock = 1 << p->cs_div[new_cs];
}