log for c37d19891df4906fc42be25aa8de8a5a56d7f905
Commit c37d19891df4906fc42be25aa8de8a5a56d7f905
committer: Michel Pollet [Wed, 14 Sep 2011 07:17:51 +0000 (08:17 +0100)]
author: Stephan Veigl [Thu, 23 Jun 2011 14:01:44 +0000 (16:01 +0200)]
Message:
output: add NO_COLOR define to disable / enable color output for simavr core messages and UART

Signed-off-by: Stephan Veigl <veigl@gmx.net>
Commit 5bd17072dcba053f114cbe09a55a6eef93998d53
committer: Michel Pollet [Wed, 14 Sep 2011 07:17:51 +0000 (08:17 +0100)]
author: Stephan Veigl [Sun, 3 Jul 2011 16:49:28 +0000 (18:49 +0200)]
Message:
doc: add doxygen file

Signed-off-by: Stephan Veigl <veigl@gmx.net>
Commit abe56ec3092859fef7bf828286c0f3ca2c6212aa
committer: Michel Pollet [Wed, 14 Sep 2011 07:16:30 +0000 (08:16 +0100)]
author: HATATANI Shinta [Thu, 8 Sep 2011 13:39:10 +0000 (22:39 +0900)]
Message:
cores: Add mega1281

Signed-off-by: HATATANI Shinta <gamaguchi@gmail.com>
Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit d5d8c51763b7da7b17f8f7ed1459174865d29944
author: Michel Pollet [Tue, 13 Sep 2011 18:38:38 +0000 (19:38 +0100)]
Message:
cores: Added mega8, old generation

Possibly would work with mega16, 32 ?

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit a722838a191f6003f7d040cac0da628c17727056 v1.0a8
author: Michel Pollet [Sun, 27 Mar 2011 10:44:22 +0000 (11:44 +0100)]
Message:
examples: Working i2c master test board

Write a few bytes to an i2c eeprom, read them back...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0093da9c8ed852fd7f3394be68716fcd7d3a8c53
author: Michel Pollet [Sun, 27 Mar 2011 10:43:40 +0000 (11:43 +0100)]
Message:
parts: Adds generic i2c eeprom slave

This part simulates an i2c eeprom, it handles most modes, including
"multiple addresses" ones, and ones with multiple byte offset bytes.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 64c6da2f80a7c4f898b89f730e0076de456b5670
author: Michel Pollet [Sun, 27 Mar 2011 10:42:00 +0000 (11:42 +0100)]
Message:
twi: Fully functional master

Now works properly, tested against Atmel's code. See
examples/board_i2ctest for a demo

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit dfca12c72062290d7a2b154e9e56eb8bd6e40f99
author: Michel Pollet [Wed, 23 Mar 2011 14:38:04 +0000 (14:38 +0000)]
Message:
examples: Fix firmware pathnames

Twas borken since I changed the build system. Now works

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 98fd52f7234dc86c27b95beb259c7c496aa7f9d7
author: Michel Pollet [Tue, 15 Mar 2011 13:41:59 +0000 (13:41 +0000)]
Message:
example: Added i2ctest

This example need some polish. It simulates an AVR with an
i2c eeprom of 1024 bytes. The eeprom is "generic" an will go to the
parts/ directory when this is fully working.
Right now write the eeprom works, but there is a stray byte somewhere;
the bug /could/ be in the atmel code tho, wich I had to fix and tweak.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f5cb51ee9eec403ec656899f02ee2a09fd4b9378
author: Michel Pollet [Tue, 15 Mar 2011 13:40:12 +0000 (13:40 +0000)]
Message:
twi: Update, 95% functional master code

Still need a bit of polish, but the logic works. Works with the
interupt based Atmel application note code.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 9033474287ed9b35a25bfd20b90d1bfd71848a2c
author: Michel Pollet [Tue, 15 Mar 2011 13:38:46 +0000 (13:38 +0000)]
Message:
run_avr: Added a signal handler

Catches control-C to make sure any VCD file is flushed

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 65367a811415dadceaa896257ab2109a002edf03
author: Michel Pollet [Tue, 15 Mar 2011 13:38:11 +0000 (13:38 +0000)]
Message:
cores: Fix TWI interupt flag

This flag was using the wrong register

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 613903e9fc0d7c809650909a68fc519b1731537e
author: Michel Pollet [Tue, 15 Mar 2011 13:37:09 +0000 (13:37 +0000)]
Message:
test: Updated uart_echo

Now set a baud rate, to excersize the new logic in the uart
simulator.
Also added a VCD file

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 9e52a7ecd4a00a02debd75184ff9daa8d170ac39
author: Michel Pollet [Tue, 15 Mar 2011 13:35:51 +0000 (13:35 +0000)]
Message:
cores: Added UART bit rate flags

Updated the cores that have UART(s) with extra flags.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 5b1830d85cd06020f50290b5e5b8e9e5e7049dae
author: Michel Pollet [Tue, 15 Mar 2011 13:33:54 +0000 (13:33 +0000)]
Message:
uart: Added logic to regulate data rate

Now uses a data rate thst is proportional to speed.
Could be made a bit better by using the cycle clock count directly,
but this method is a bit clearer

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f871e491959a4f5b8fc0c6cb1ccc2b95626c1b8c v1.0a7
committer: Michel Pollet [Wed, 9 Mar 2011 07:59:50 +0000 (07:59 +0000)]
author: Sami Liedes [Mon, 28 Feb 2011 19:27:29 +0000 (21:27 +0200)]
Message:
misc: Fixes various typos

Author:    Sami Liedes <sliedes@cc.hut.fi>
Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit c95077cc5166fb332a9772e29748085db9470d19
committer: Michel Pollet [Wed, 9 Mar 2011 07:59:50 +0000 (07:59 +0000)]
author: Sami Liedes [Mon, 28 Feb 2011 21:37:59 +0000 (23:37 +0200)]
Message:
Fix interupt -> interrupt typo, including in some function names.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 9f4d192d318aedee0ff964033a7accf6e9b544ed
committer: Michel Pollet [Wed, 9 Mar 2011 07:57:07 +0000 (07:57 +0000)]
author: Sami Liedes [Mon, 28 Feb 2011 21:33:08 +0000 (23:33 +0200)]
Message:
Do not let code clear the UDRE flag in USART.

It's a read only location and clearing it may break software that
assumes it cannot be cleared.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 1a0be9da2363a0230e5012d1739997c3be323512
author: Michel Pollet [Wed, 9 Mar 2011 07:56:50 +0000 (07:56 +0000)]
Message:
Merge remote-tracking branch 'sliedes/to-upstream' into dev-home
Commit 59243c631fd53642073ddbe032236a1cd413ca3a
committer: Sami Liedes [Wed, 2 Mar 2011 21:31:11 +0000 (23:31 +0200)]
author: Sami Liedes [Mon, 28 Feb 2011 20:02:06 +0000 (22:02 +0200)]
Message:
Tweak struct avr_t to always include a pointer to trace data structure.

Previously the size of struct avr_t was dependent on whether the
preprocessor macro CONFIG_SIMAVR_TRACE was defined. This was problematic
since it meant that applications that link to simavr need to define it
the same way as it is defined in simavr Makefiles.

Change it to a single pointer to a struct, which is allocated iff
tracing is compiled in and a NULL pointer otherwise.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit bc18dfff2f0a44461d6be2264511b3e8e63dbcac
committer: Sami Liedes [Mon, 28 Feb 2011 03:31:36 +0000 (05:31 +0200)]
author: Sami Liedes [Fri, 11 Feb 2011 01:02:33 +0000 (03:02 +0200)]
Message:
Automate test cases.

This patch implements a framework for test cases. Each test case is
compiled into an individual executable. All test cases can be run by
invoking the command `make run_tests', which runs the shell script
run_tests.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 27ba3fb4c8f2a463a1364d6787c3a6d50644d5f3
committer: Sami Liedes [Mon, 28 Feb 2011 01:07:44 +0000 (03:07 +0200)]
author: Sami Liedes [Sun, 20 Feb 2011 16:55:10 +0000 (18:55 +0200)]
Message:
Include sim_gdb.h from sim_gdb.c. Also fix prototype in .h.

sim_gdb.c did not include sim_gdb.h. Also there was a slight
difference in the prototype in the header and the implementation in
the .c, causing a warning.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 80da5988ce9cdccce293fb084880638f1657c52d
author: Michel Pollet [Sun, 27 Feb 2011 20:34:07 +0000 (20:34 +0000)]
Message:
uart: Touchup on the xon/xoff IRQs

Set/reset XON & XOFF irqs following the status
of the fifo. It means they can be added to a VCD
file and help debug a "part".

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 2c3afb1f55a6f6b5553070fb09e95ec8add12c3d
author: Michel Pollet [Thu, 24 Feb 2011 18:05:06 +0000 (18:05 +0000)]
Message:
uart: Added a comment

As to why somehow we don'r write a value in the interupt
clearing logic

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 13ee4cc59eab9c0972bdea63bee9f74757fc609f
author: Michel Pollet [Thu, 24 Feb 2011 18:03:24 +0000 (18:03 +0000)]
Message:
twi: Placeholder example board

Uses AVR application note implementation of master/slave mode
Placeholder, non functional

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit dc427b7efc7905fb825722a67bd2a480615dd3b6
author: Michel Pollet [Thu, 24 Feb 2011 18:02:35 +0000 (18:02 +0000)]
Message:
twi: New master implementation

Yanked the old overengineered version, replaced it with a KISS
version. Untested, work in progress. Needs a new testing harness

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 9b9582d7653649bde0a960cfb21574a1a57ae63c
author: Michel Pollet [Thu, 24 Feb 2011 18:01:40 +0000 (18:01 +0000)]
Message:
regbits: Added a "raw" variant to get/set

Allows comparing to "real life" constants, used in Twi module

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 663049635100d7e6b982330a9a42a937fa2e6a68
author: Michel Pollet [Thu, 24 Feb 2011 18:01:01 +0000 (18:01 +0000)]
Message:
part: Made irq_names static

Have to to have several of them...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit c9dcd6ca2f5d129590466cd3f812faf9a7382705
author: Michel Pollet [Wed, 23 Feb 2011 17:56:08 +0000 (17:56 +0000)]
Message:
Makefile: Fix for x86_64

silly architecture names...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 8a61b76cfe23c1d953f737aa8d836782ee8d40c6
author: Michel Pollet [Wed, 23 Feb 2011 13:55:29 +0000 (13:55 +0000)]
Message:
Makefile updates

Changed the makefiles to derivate the target architecture from
gcc itself, and compile all the objects into obj-$arch. This
allows several compilers to be used to build simavr, at the same
time without interferences.

This allow arm cross compilation to live in the same tree as
the x86 one...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit d7369e56ac33daca0a705d96d6ee2509d3b42543
author: Michel Pollet [Wed, 23 Feb 2011 13:53:19 +0000 (13:53 +0000)]
Message:
Updated gitignore

Added obj-* and *.vcd

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f91dd3b55d0a4051bdd402e796c1d62bc819742b
committer: Michel Pollet [Wed, 23 Feb 2011 11:15:21 +0000 (11:15 +0000)]
author: Sami Liedes [Wed, 23 Feb 2011 02:14:29 +0000 (04:14 +0200)]
Message:
Remove unused variable from avr_service_interrupts().

The done flag is nowadays redundant as it's never read after it's set.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 3c84d92136c907749bc4b87067e196cf2df1c69c
committer: Michel Pollet [Wed, 23 Feb 2011 11:14:55 +0000 (11:14 +0000)]
author: Sami Liedes [Sat, 19 Feb 2011 03:35:57 +0000 (05:35 +0200)]
Message:
Fix LD, ST, LPM, STS, MUL to take the correct number of cycles.

They are now the ATMega timings. Need to figure out how to take
ATTiny into account. Before this change they weren't correct for
either.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 941c7a9b7812b38f04d88a76640bb3df8e0482ab
committer: Michel Pollet [Wed, 23 Feb 2011 11:14:44 +0000 (11:14 +0000)]
author: Sami Liedes [Wed, 2 Feb 2011 17:20:31 +0000 (19:20 +0200)]
Message:
fix typos in comments.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit dea35993f4e8257294eb1e8b27a8416b7a401beb
committer: Michel Pollet [Wed, 23 Feb 2011 11:14:28 +0000 (11:14 +0000)]
author: Sami Liedes [Sat, 5 Feb 2011 13:56:33 +0000 (15:56 +0200)]
Message:
Silence gcc warnings by using PRIu64 in CRASH() printf().

Actually we define a PRI_avr_cycle_count preprocessor macro in
sim_avr.h in the style of PRI* in inttypes.h.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 6541b6de0a998400166bd6b8cf26ef1b689140dc
committer: Michel Pollet [Wed, 23 Feb 2011 00:49:14 +0000 (00:49 +0000)]
author: Sami Liedes [Wed, 23 Feb 2011 00:13:24 +0000 (02:13 +0200)]
Message:
Fix compilation with TRACE on.

The MOV instruction's TRACE() used the undefined variable vd.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 1d661de0943330b20a0b8dc938d17c0e742a2b89
committer: Michel Pollet [Wed, 23 Feb 2011 00:48:45 +0000 (00:48 +0000)]
author: Sami Liedes [Wed, 23 Feb 2011 00:03:13 +0000 (02:03 +0200)]
Message:
Fix compilation on non-32-bit platforms.

The addition of -Werror to the compilation flags broke building on
64-bit hosts because casts between pointers and integers of different
sizes cause warnings on gcc -Wall. Fix this by always casting the
pointers to intptr_t first.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 4ca5fe4e37ff264a11d83331df1efd552887fe22
author: Michel Pollet [Tue, 22 Feb 2011 23:20:36 +0000 (23:20 +0000)]
Message:
irq: Add names to most io module external irqs

Nothing to be shown for this work so far, the cool stuff hopefully
will come later...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 1b195f1240ed2c7e0fbc6b2152aa4ac73eceb793
author: Michel Pollet [Tue, 22 Feb 2011 17:27:45 +0000 (17:27 +0000)]
Message:
doc: Updated callgraph .pdf

Just a minor update

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 5183ee71b76d81d2833a1febb4ed897e117e9a28
author: Michel Pollet [Tue, 22 Feb 2011 17:26:40 +0000 (17:26 +0000)]
Message:
examples: Updated to new part prototypes

Followup on previous checkin, the board examples now use
"names" when possible.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 224f9dacd14a39a06d4c93dd1106a7883d59cdff
author: Michel Pollet [Tue, 22 Feb 2011 17:25:43 +0000 (17:25 +0000)]
Message:
parts: Updated to name their IRQs

First bits of the system that provide names for the IRQs

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b175b245541078b2a359a8b36a057840fe14c92b
author: Michel Pollet [Tue, 22 Feb 2011 17:24:52 +0000 (17:24 +0000)]
Message:
simavr: Updare simavr core to new IRQ prototypes

Mostly prototypes changes and some gratuitous reformatting

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 4462c22a8cc1a77ed592b0fac3d227850c5cd86a
author: Michel Pollet [Tue, 22 Feb 2011 17:23:54 +0000 (17:23 +0000)]
Message:
irq: Introduce a "irq pool"

The goal is to be able to name IRQs, so a couple fields are
added.
It is not functional for now, as the task is to first convert
all the code to the new prototype.

Also introduce a 2011 way of formatting prototypes

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 91bf258f46d9903a1cd253cab9e7f7dfcfb151ef
author: Michel Pollet [Tue, 22 Feb 2011 17:21:54 +0000 (17:21 +0000)]
Message:
simavr: Added -Werror and fixed warnings

Added -Werror to compilation to make sure the next wave of changes
can't easily  break things

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0fa2d31cec6d8d64fc5dd22bb6e6c8cab538562f
author: Michel Pollet [Tue, 22 Feb 2011 12:50:51 +0000 (12:50 +0000)]
Message:
core: Add a muxer for IO writes

It turns out that some core (tiny85 at the very least) are competing
for IO writes on some register.
This patch introduces a muxer callback that can call multiple clients
without impacting performance for the rest of the cores.

The system could be extended for IO read if it proves necessary.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 335869fab028466961751b8e2a5a9ebd1ac50d46
author: Michel Pollet [Tue, 22 Feb 2011 12:48:31 +0000 (12:48 +0000)]
Message:
core: Introduce run() and sleep() callbacks

It seems that the default 'run_avr' function was penalized by
some tests made that were only useful when gdb was active.

This patch introduces two version of the critical run_avr, one for
"raw" running, and one for gdb.

It also introduces a sleep() callback for similar reasons. Ir can
also be used to run unit testing at 100% speed instead of having
random sleep code during execution.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit c1c2133e6eea59d30d9ffaad538c0d0252016cd5
committer: Michel Pollet [Mon, 21 Feb 2011 23:18:25 +0000 (23:18 +0000)]
author: Sami Liedes [Sun, 20 Feb 2011 16:52:32 +0000 (18:52 +0200)]
Message:
Fix SBIS etc trace output.

SBIS used to print the io register wrong. The other fixes add spaces
in the correct places in "Will branch" and "Will not branch" messages.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 2a012a045c4d75bf9cb97ca1d4034a40afefe8c8
committer: Michel Pollet [Mon, 21 Feb 2011 23:17:38 +0000 (23:17 +0000)]
author: Sami Liedes [Sat, 19 Feb 2011 03:25:53 +0000 (05:25 +0200)]
Message:
avr_loadcode(): If too much code, bail out instead of crashing.

Check that the code to be loaded actually fits in the flash.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit b682e4b6309f42fe5b3babec0935461264bcd785
committer: Michel Pollet [Mon, 21 Feb 2011 23:17:18 +0000 (23:17 +0000)]
author: Sami Liedes [Fri, 18 Feb 2011 20:09:24 +0000 (22:09 +0200)]
Message:
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>
Commit da77ed14ee19be9f3cf0fabe1eb1efb0085bcf04
author: Michel Pollet [Mon, 21 Feb 2011 18:05:44 +0000 (18:05 +0000)]
Message:
board_hd44780: New sample code

Emulated a complete HD44780 LCd screen, and uses a standard
AVR driver to write on it.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 4c8f1e4cff73e635c187d029b325ba512224e29e
author: Michel Pollet [Mon, 21 Feb 2011 18:02:03 +0000 (18:02 +0000)]
Message:
vcd: Increase trace buffer size

Ran into the 128 limit at some point..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 049b3be858177cc8efac9a36940d56470265ddf6
author: Michel Pollet [Mon, 21 Feb 2011 18:01:17 +0000 (18:01 +0000)]
Message:
Makefiles: Some fixups

+ add -fPIC to -shared for the shared library
+ .axf rule try to comoile all dependencies

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f9b556eb54397ec4872130b7132ea5d5ac2b0a97
author: Michel Pollet [Sun, 20 Feb 2011 10:20:52 +0000 (10:20 +0000)]
Message:
Merge git://gitorious.org/~luki/simavr/lukis-simavr into dev-home
Commit 1b2e289952e77d5b57d993362f36c9a4974df78f
committer: Michel Pollet [Sun, 20 Feb 2011 10:14:10 +0000 (10:14 +0000)]
author: Martin Glueck [Sat, 19 Feb 2011 18:55:43 +0000 (19:55 +0100)]
Message:
Makefile: Add building of shared library on linux

Disabled for non linux platform, as it need more work
than just a gcc -shared

Author:    Martin Glueck <martin@mangari.org>
Edit:    Michel Pollet <buserror@gmail.com>
Commit f21e010e1a70e5ff4b507096b3492b62e6676d4b
committer: Michel Pollet [Sun, 20 Feb 2011 10:13:03 +0000 (10:13 +0000)]
author: Martin Glueck [Sat, 19 Feb 2011 18:20:18 +0000 (19:20 +0100)]
Message:
core: Added ATtiny x4

Untested. Also added to sim_avr.c

Author:    Martin Glueck <martin@mangari.org>
Edit:    Michel Pollet <buserror@gmail.com>
Commit c1a849dc1b8a86c6d00970421b27756580ba6ac7
author: Michel Pollet [Sat, 19 Feb 2011 00:21:53 +0000 (00:21 +0000)]
Message:
core: Remove the run() callback

run() callback was unused but was still using cycles

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 556907d2f28e542903dcab88498dbd8ba6f689cf
author: Michel Pollet [Fri, 18 Feb 2011 15:52:52 +0000 (15:52 +0000)]
Message:
Makefiles: Explicitely link opengl

needed with modern linker

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 6df40e824c0b686b12d14193ebb0e944aee697eb
committer: Sami Liedes [Thu, 17 Feb 2011 19:57:53 +0000 (21:57 +0200)]
author: Sami Liedes [Thu, 17 Feb 2011 19:47:00 +0000 (21:47 +0200)]
Message:
timer: Fix a subtle off-by-one bug in TCNT reading.

There's a subtle bug in TCNT (timer counter) reading which only causes
the counter to ever run from 0 to TOP-1, while it should stay in the
TOP value for a full timer cycle before resetting to 0 (but the
interrupt needs to come when TOP is first reached).

Interestingly, this causes Arduino's micros() function to occasionally
return incorrect values. micros() function relies on TCNT0 not
transitioning from <= 254 to 0 in only a few cycles with /64
prescaler.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit b778a45f49549badc2980ac79ca18a4ae7b5c5b5
author: Michel Pollet [Wed, 16 Feb 2011 00:03:28 +0000 (00:03 +0000)]
Message:
timers: don't reconfigure for minor changes

Prevents the timer to be reset when changing non important
bits, like the edge detector etc

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 5c3675cd3770a69b72bfc6b95429ad6f7aa163aa
author: Michel Pollet [Wed, 16 Feb 2011 00:02:01 +0000 (00:02 +0000)]
Message:
timers: Print a warning on unsuported timer modes

and also don't [rint one for "mormal" mode

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 199a5e98393ec3151eec2464cf97f23ebb65740f
author: Sami Liedes [Tue, 15 Feb 2011 23:21:38 +0000 (01:21 +0200)]
Message:
Store the next cycle count where the earliest cycle timer needs to be run.
This speeds up cycle timer processing significantly and almost doubles
the speed of the overall simulation.

Signed-off-by: Sami Liedes <sliedes@cc.hut.fi>
Commit 0fc01c9ab7f8ab9d4c4f79fa0a2ee13e927324f3
committer: Sami Liedes [Fri, 4 Feb 2011 23:57:06 +0000 (01:57 +0200)]
author: Sami Liedes [Fri, 4 Feb 2011 23:46:08 +0000 (01:46 +0200)]
Message:
Rework avr_service_interrupts() to use ffs() too for speed.
Commit 467931d9b79e3122aacb1fe4270b32963a41886d
committer: Sami Liedes [Fri, 4 Feb 2011 22:38:54 +0000 (00:38 +0200)]
author: Sami Liedes [Fri, 4 Feb 2011 22:26:54 +0000 (00:26 +0200)]
Message:
Use ffs() for finding timers from cycle timer map.

This optimization speeds up avr_cycle_timer_process() considerably. It
used to be a major bottleneck in my test case (52% of CPU time spent
in that routine), now it's about half that.
Commit 8c526abb7d8c2a0bacddf38a0c187738a6c0bf9a
committer: Sami Liedes [Wed, 2 Feb 2011 20:53:38 +0000 (22:53 +0200)]
author: Sami Liedes [Wed, 2 Feb 2011 20:18:04 +0000 (22:18 +0200)]
Message:
Return zeros when GDB reads just past end of stack.

GDB likes to read the topmost value of stack when using the
"stepi" (step instruction) command. Unfortunately this does not work
when the stack is empty, causing an error message and GDB confusion.

Hack the GDB stub code to just return zeros if GDB tries to read two
bytes just past the end of stack.

NOTE: This may need to be modified to support also longer reads for
bigger AVRs where code pointers are longer than two bytes (e.g.
ATMega2560). As simavr doesn't support atm2560 yet, I'm implementing
it this way now.
Commit 248a15167a3d116da59b493dbd381706b5dd5370
committer: Sami Liedes [Wed, 2 Feb 2011 20:53:04 +0000 (22:53 +0200)]
author: Sami Liedes [Wed, 2 Feb 2011 17:23:45 +0000 (19:23 +0200)]
Message:
Enable interrupt handling for Fast PWM timers too

Arduino seems to use that.
Commit dc151e032e426d08f289c86defc830192b7946af v1.0a6
author: Michel Pollet [Fri, 14 Jan 2011 10:19:28 +0000 (10:19 +0000)]
Message:
UART: Fixed UDRC/E behaviour

The interrupt is suposed to fire as soon as it is
enabled is the UDR is empty.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 968403610e6f99cbbc5ec5d945056215bd1604d7
author: Michel Pollet [Fri, 14 Jan 2011 10:18:40 +0000 (10:18 +0000)]
Message:
cycle timers: Added avr_cycle_timer_status()

Allows verification wether a timer is running, and
until when it is.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 32172159818cc6b3fc1124fa7ddaaefe68ed2713
committer: Michel Pollet [Mon, 25 Oct 2010 11:59:00 +0000 (12:59 +0100)]
author: Christian Balles [Tue, 19 Oct 2010 22:00:28 +0000 (00:00 +0200)]
Message:
simduino: added init/deinit functions for avr_t initialization

fixes a crash (free of mmap'ed memory)
nicer cleanup by munmap + close the file

Signed-off-by: Christian Balles <code@ballessay.de>
Commit f1ce544edfec2a00d171ccac805c3336b50e704a
committer: Michel Pollet [Mon, 25 Oct 2010 11:59:00 +0000 (12:59 +0100)]
author: Christian Balles [Tue, 19 Oct 2010 21:45:58 +0000 (23:45 +0200)]
Message:
core: added extra init/deinit functions to avr_t

allows programs like the simduino example to modify the init/deinit function
to fix a crash

Signed-off-by: Christian Balles <code@ballessay.de>
Commit b28d03a16bad7df6303b7798da3cb563bd0de06b
author: Michel Pollet [Mon, 25 Oct 2010 11:53:29 +0000 (12:53 +0100)]
Message:
misc: Typos

Fixed a few comments

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 7a591ae2df3b1f62ae2c45fe8ced6d81f7dae821
author: Michel Pollet [Tue, 12 Oct 2010 09:03:43 +0000 (10:03 +0100)]
Message:
core: Added a bit of documentation

Fixed some of the copy/paste errors in comments

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 398c292e97b5a3309fd1114988e1afdb31d0083c
author: Michel Pollet [Tue, 12 Oct 2010 09:02:55 +0000 (10:02 +0100)]
Message:
gdb: Adds the 'reset' command

Apparently needed for compatibility with AVRStudio debugger

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit e1cbefc091c5e698fa8157fadafd35446e7b918a
author: Michel Pollet [Tue, 12 Oct 2010 09:02:03 +0000 (10:02 +0100)]
Message:
console: Implement debug console register

Used in pair with the console register declaration, just
prints what's sent to that debug register.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f729045cbe16179aad8afdddde80c457a335608e
author: Michel Pollet [Tue, 12 Oct 2010 09:00:33 +0000 (10:00 +0100)]
Message:
mcu_section: Added New CONSOLE Tag

CONSOLE tag allow declaring a register for dumping debug output
oh the terminal without using an UART

Also cleaned up and documented the header file further

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b80e6f66966b4356ef3b207ad8bac1c9a56ef480
author: Michel Pollet [Thu, 2 Sep 2010 12:01:25 +0000 (13:01 +0100)]
Message:
tests: Update them so they work...

They relied on bugs that were fixed in simavr since..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 8b7739b4a78f594ce7cf011f5031836c4c62c72f
author: Michel Pollet [Thu, 2 Sep 2010 12:00:48 +0000 (13:00 +0100)]
Message:
IOs: Use new IRQ alloc function

All converted to the brand new way...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 83d4a7e3552c184c18baa384487eedf10929cb3a
author: Michel Pollet [Thu, 2 Sep 2010 11:59:59 +0000 (12:59 +0100)]
Message:
IRQs: A bit of sanity when freeing

Check the parameters...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit c8c74557657e0b89904538344f2127128c95d62a
author: Michel Pollet [Thu, 2 Sep 2010 11:56:29 +0000 (12:56 +0100)]
Message:
simavr: Deallocate resources

Deallocate memory and IO modules at teardown

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f7baf8c57b19b791863c1e9bb6e59c967ddd4871
author: Michel Pollet [Thu, 2 Sep 2010 11:55:40 +0000 (12:55 +0100)]
Message:
eeprom: Added a dealloc function

frees the eeprom memory at teardown time

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 2a257b4e22df120dd4a811012675158039a93c7d
author: Michel Pollet [Thu, 2 Sep 2010 11:55:05 +0000 (12:55 +0100)]
Message:
ios: Added a way to set and teardown modules IRQs

Added a function to set the io module IRQ, and added a way
to deallocate them at teardown time.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 8d8d509d59334ba6d031f0b8544bf7aa89ac546e
author: Michel Pollet [Thu, 2 Sep 2010 10:59:07 +0000 (11:59 +0100)]
Message:
misc: Made (most) of the headers c++ friendly

No functional changes

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 6280c0db426bfca89fd4bd1015b1bbda44296314 v1.0a5
committer: Michel Pollet [Tue, 31 Aug 2010 11:43:24 +0000 (12:43 +0100)]
author: Michel Pollet [Tue, 31 Aug 2010 11:31:37 +0000 (12:31 +0100)]
Message:
misc: Fixed clang static analizer warnings

One genuine bug too. The rest was cosmetic.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 2a64138243a89df06b0f6ab4c9ce47f130af53d9
author: Michel Pollet [Tue, 31 Aug 2010 10:55:29 +0000 (11:55 +0100)]
Message:
ioport: Added an IRQ for the port pin direction changes

New IRQ for client code (ie "board code") will be called
when the AVR firmware changes the DDR register.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit ad7ea664f377587f9e91b6c685e8bbedd8f489d4
author: Michel Pollet [Tue, 31 Aug 2010 10:48:44 +0000 (11:48 +0100)]
Message:
ioport: Add an ioctl to get the port state

Example:
for (int i = 'A'; i <= 'F'; i++) { avr_ioport_state_t state;
if (avr_ioctl(AVR_IOCTL_IOPORT_GETSTATE(i), &state) == 0)
printf("PORT%c %02x DDR %02x PIN %02x\n",
state.name, state.port, state.ddr, state.pin);
}

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 2df48dd56ca8c9f93e9c20dc98492408d0b34f5b
author: Michel Pollet [Tue, 31 Aug 2010 10:30:49 +0000 (11:30 +0100)]
Message:
misc: Typos etc

Makefile now uses $(CC) so it works with clang static analyzer.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit e0e85ba6e358f9d5b757671e1a7d236f522f3bb4
author: Michel Pollet [Wed, 25 Aug 2010 15:07:31 +0000 (16:07 +0100)]
Message:
core: CALL/RET instructions fix

Swap LSB and MSB of return address on the stack.
Thanks to "Peter" on the simavr mailing list.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f4b8df2dc232bc3f111c27212e54b6cbb8fe6851
author: Michel Pollet [Tue, 10 Aug 2010 21:51:31 +0000 (22:51 +0100)]
Message:
core: Add PORTA support for Attiny2313

The Attiny2313 has a PORTA, the pins for it are normally used for
reset and the crystal, but it is possible to use them if you use the
internal R/C oscilator.
Simavr didn't support this port on a Attiny2313 yet, so I added it myself.

Signed-off-by: Wander Winkelhorst <w.winkelhorst@gmail.com>
Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0d3f95abd5081d99eee487223c01ff31311d3f0b
author: Michel Pollet [Mon, 2 Aug 2010 21:38:44 +0000 (22:38 +0100)]
Message:
timer: Fix for older AVRs & tinies

They lack WGM bits

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 4055170baf10c38cee41c87e988b7d992f306131 v1.0a4
author: Michel Pollet [Mon, 5 Jul 2010 10:09:20 +0000 (11:09 +0100)]
Message:
core: Fix SBRS/C for 32 bits instructions

Untested, but matches the datasheet

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 9567c05d43d21ecc4fcb526109773f7174a6c4cd
author: Michel Pollet [Mon, 5 Jul 2010 10:08:08 +0000 (11:08 +0100)]
Message:
core: Fix MULS register

MULS uses 16+ registers.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 43f857c899e543312dbabb2e53d8eaf10f6c82f6
author: Michel Pollet [Fri, 25 Jun 2010 08:17:19 +0000 (09:17 +0100)]
Message:
ADC: Fix ADLAR bit handling

Was shifting when zero, not one.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit d784bdd3232472f44a1c49c78f68912b109f849c
author: Michel Pollet [Sun, 20 Jun 2010 10:25:53 +0000 (11:25 +0100)]
Message:
timer: Also reconfigure on writing the WGM bits

Some broken code configure the clock source before
setting the waveform bits.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 160884eda003b467dfe92cb007c4f25a6cb5e6e1
author: Michel Pollet [Sun, 20 Jun 2010 10:24:54 +0000 (11:24 +0100)]
Message:
ioports: Cleanup and implement PINx toggle

Turns out writing 1 to PINx register toggles the
bit in PORTx. Did'nt know it worked like that...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 630883c7ad7b7db4b59b3a8a9fa5a975408d3278
author: Michel Pollet [Tue, 11 May 2010 11:36:26 +0000 (12:36 +0100)]
Message:
uart: Now use avr_clear_interrupt_if

New function simplifies clearing pending bits

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 7e3e150b0ee5a4af352b26e96a6512272214d69e
author: Michel Pollet [Tue, 11 May 2010 11:35:46 +0000 (12:35 +0100)]
Message:
timer: Allow clearing of the interupts

Allow exclicit clearing of interupts by writing 1
to the pending bit.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 1b82822bf8b61bd4aa84882112f9f4690e865e15
author: Michel Pollet [Tue, 11 May 2010 11:34:35 +0000 (12:34 +0100)]
Message:
interrupts: Mark interupts as pending even if not enabled...

.. Then trigger them as soon as they are enabled again

There is a bit of performance hit on this, since the bitmask
array used before can now be full of pending bits that won't
ever be cleared..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit d22d7636f84b511ef601bdd87d76dff6d5bdca2a
author: Michel Pollet [Thu, 29 Apr 2010 10:51:45 +0000 (11:51 +0100)]
Message:
ICP: Added Input capture pin support to timers

Added (untested as of now) Input Pin Capture to the 16 bits
timers. The "edge" flag is also handled. The code is untested
for now, it will need an "example" board that will be
checked in later.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 42dab7385192880a35e9d88f64dc19c1b8d94393 v1.0a3
author: Michel Pollet [Wed, 14 Apr 2010 21:59:23 +0000 (22:59 +0100)]
Message:
cores: Added tinyX5 and mega128 ADC bits

Not tested

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 3d05eefe53540c6abfbdf9cd5498ae9f0e2b44b6
committer: Michel Pollet [Wed, 14 Apr 2010 19:47:49 +0000 (20:47 +0100)]
author: Alessio Igor Bogani [Wed, 14 Apr 2010 18:17:36 +0000 (20:17 +0200)]
Message:
misc: Warning fix

Makes gcc happy

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0e289207e004cc765cecf1e93d3fa27dec0cec3e
committer: Michel Pollet [Wed, 14 Apr 2010 19:46:15 +0000 (20:46 +0100)]
author: Alessio Igor Bogani [Wed, 14 Apr 2010 18:17:24 +0000 (20:17 +0200)]
Message:
misc: More warning fixes

#warning "This file has been moved to <util/delay.h>."

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Signed-off-by: Michel Pollet <buserror@gmail.com>