timers: Added TCNT reading/writing support
authorMichel Pollet <buserror@gmail.com>
Mon, 21 Dec 2009 21:08:45 +0000 (21:08 +0000)
committerMichel Pollet <buserror@gmail.com>
Mon, 21 Dec 2009 21:08:45 +0000 (21:08 +0000)
commite3a37a324adcd5db12fe8ee11384f9bd0f9081bb
treed02b62a704f137c40da01a8f458d5dd980a6e720
parent22055328357d8b6490c1d648f7ea1b39f8831a6d
timers: Added TCNT reading/writing support

TCNT read/write is now working. It is recalculated at read time.
You can also write to it to reset the timer to a fixed value, this resets
the simavr timer base accordingly.
Note that some timer modes should /not/ let the AVR write to TCNT, this
is not handled right now.

Also added an example of AVR code that uses timers, change TCNT1 and
generates a nice trace file with all the changes.

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/avr_timer.c
simavr/sim/avr_timer.h
tests/atmega88_timer16.c [new file with mode: 0644]