avr_register_io_[read,write](): fail if overriding earlier registration.
authorSami Liedes <sliedes@cc.hut.fi>
Fri, 18 Feb 2011 20:09:24 +0000 (22:09 +0200)
committerMichel Pollet <buserror@gmail.com>
Mon, 21 Feb 2011 23:17:18 +0000 (23:17 +0000)
commitb682e4b6309f42fe5b3babec0935461264bcd785
treefdfedcb41e40420bc32229d0f3611959d3547dca
parentda77ed14ee19be9f3cf0fabe1eb1efb0085bcf04
avr_register_io_[read,write](): fail if overriding earlier registration.

The avr_register_io_*() functions do not maintain a chain of
callbacks. This can be confusing if someone like me tries to use them
to listen to some I/O events (for which you should use the avr_irq_*
stuff).

Make this more explicit by checking in the register functions if we
already have a callback and failing with an error message if so.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
simavr/sim/sim_io.c