log for 51ee34499cc82938905864003b2f04eb71790581
Commit 51ee34499cc82938905864003b2f04eb71790581
committer: Stephen Drake [Mon, 18 Jan 2016 05:05:28 +0000 (18:05 +1300)]
author: Stephen Drake [Fri, 18 Dec 2015 05:12:00 +0000 (18:12 +1300)]
Message:
build: updated support for building with MacPorts

Updated Macports support based on Homebrew support.  Set correct paths
for MacPorts-provided avr-gcc and libelf.
Commit 0ba0c726cf72ae4621e0801bd63f805bcc2a77d9
author: Stephen Drake [Mon, 18 Jan 2016 04:54:36 +0000 (17:54 +1300)]
Message:
gdb: support sleep interval of 1s or greater

Split sleep interval into seconds and microseconds to create a valid
timeval to pass as the timeout to select().

Removed comment, which refers to old code that used a fixed interval.
Commit 7cab53372b15f34af7eae347c01b8fe498ac215f
author: Michel Pollet [Fri, 30 Oct 2015 18:22:48 +0000 (18:22 +0000)]
Message:
Merge pull request #145 from xqms/interrupt_fifo_fix

sim_interrupts: fix FIFO move operation
Commit 5bc1f43dbedbb3d38fafaff0f60868377756e02f
author: Max Schwarz [Mon, 26 Oct 2015 11:15:30 +0000 (12:15 +0100)]
Message:
sim_interrupts: fix FIFO move operation

The variable 'mini' is a FIFO index, not a direct index into the buffer!
Add the current read pointer to fix the operation.

Fixes a regression introduced in 599733f261f94317489c2cc8751fb84fd604e6fa.
Commit 2062c2ddea13488d8d766331c5432b5bb2ae1fea
author: Michel Pollet [Thu, 15 Oct 2015 19:53:51 +0000 (20:53 +0100)]
Message:
Merge pull request #141 from bsekisser/bsekisser-master-core-access-r16-fixup

core: fixup missing dependancy from r16 commit
Commit f2ebab47d69ee01d4c9f2cc04496e71665a8ab76
author: bsekisser [Thu, 15 Oct 2015 18:24:43 +0000 (14:24 -0400)]
Message:
core: fixup missing dependancy from r16 commit

several commits were pushed to a branch which I later split...
one commit had a dependency I missed which this fixes.

modified:   sim/sim_core.c
fix missing dependance in MOVW instruction.
Commit 9037530123ea6b8fae12b3b96fd0c35295f48cea
author: Michel Pollet [Mon, 12 Oct 2015 09:41:24 +0000 (10:41 +0100)]
Message:
Merge pull request #135 from bsekisser/bsekisser-master-timer-clear-cancel-changes

avr_timer: add avr_timer_clear_and_cancel_all_cycle_timers
Commit 3ee01a680e134bd0517404854d957a58e9cf3ca2
author: Michel Pollet [Mon, 12 Oct 2015 09:39:18 +0000 (10:39 +0100)]
Message:
Merge pull request #134 from bsekisser/bsekisser-master-core-access-r16

core: add pair of 16 bit set register functions
Commit cb2523ce79ac489b8a988beba9e2afe9a6a61bf8
author: bsekisser [Sat, 10 Oct 2015 10:22:37 +0000 (06:22 -0400)]
Message:
timer: rework timer clear commit.

reworked to use single function with const flag to clear.
set to inline, depends on dce.

modified:   sim/avr_timer.c
Commit 5570362835d8e60d4fbf80a3fd71d585cc0642d6
author: Michel Pollet [Tue, 6 Oct 2015 16:32:05 +0000 (17:32 +0100)]
Message:
Merge pull request #133 from bsekisser/bsekisser-master-core-access-flash16

core: change 16 bit flash access
Commit f777601970b5b0adc0c1242b528728e10d7b86d0
author: bsekisser [Mon, 5 Oct 2015 19:30:14 +0000 (15:30 -0400)]
Message:
avr_timer: add avr_timer_clear_and_cancel_all_cycle_timers

modified:   sim/avr_timer.c
added: avr_timer_clear_and_cancel_all_cycle_timers
fixes a few oversights in original commit(s)
Commit c99dc41e0754c0d6d8e50f26da23ae22e44d1701
committer: bsekisser [Mon, 5 Oct 2015 18:57:12 +0000 (14:57 -0400)]
author: bsekisser [Sun, 4 Oct 2015 23:13:47 +0000 (19:13 -0400)]
Message:
core: add pair of 16 bit set register functions

added: _avr_set_r16le and _avr_set_r16le_hl
_avr_set_r16le_hl preserves reverse register set order where used
two register set calls become a single call.
Commit f2e826ea684999d0f26ccbcfe61d22c6815bb747
author: bsekisser [Sun, 4 Oct 2015 22:23:55 +0000 (18:23 -0400)]
Message:
core: change 16 bit flash access

modified:   sim/sim_core.c
added _avr_flash_read16le accessor function
changed "avr->flash[addr] | (avr->flash[addr + 1] << 8)"
to "_avr_flash_read16le(avr, addr)"
Commit 27b7364a7a5da5f592d76c221fcb8cc38745d32c
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:53 +0000 (07:24 +0100)]
author: Michel Pollet [Tue, 15 Sep 2015 13:34:29 +0000 (14:34 +0100)]
Message:
ioport: Don't crash if core defition is incomplete

This is not something that happends on existing cores, but can be
annoying when defining a new one.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit ea3f62f95e23172124b5f71e37f29e0839356586
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:53 +0000 (07:24 +0100)]
author: Michel Pollet [Tue, 15 Sep 2015 13:33:33 +0000 (14:33 +0100)]
Message:
io: No functional changes

Just reformating

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit d13d7d499399a59773c80f86164a3133aefcf2ed
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:53 +0000 (07:24 +0100)]
author: Michel Pollet [Tue, 15 Sep 2015 13:32:41 +0000 (14:32 +0100)]
Message:
timer: Added a selective trace option

Allows tracing one timer only

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit ac2b17b1a04ea1212534c1e212584ee6647c4a6a
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:53 +0000 (07:24 +0100)]
author: Michel Pollet [Thu, 20 Aug 2015 12:43:09 +0000 (13:43 +0100)]
Message:
arduidio: Simplified pin mapping

Again...

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit ab7b286beda317a01ef96485f66155a523896dcc
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:53 +0000 (07:24 +0100)]
author: Michel Pollet [Fri, 24 Jul 2015 15:28:22 +0000 (16:28 +0100)]
Message:
timers: Gratuitous realignment

Go on with the new, improved narrow codestyle

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 919dacb22088a134db1058ee4afebf958f620730
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:52 +0000 (07:24 +0100)]
author: Michel Pollet [Fri, 24 Jul 2015 15:25:11 +0000 (16:25 +0100)]
Message:
ADC: Skip SRB register if not present

the mega8/16/32 don't have ADCSRB, this lead to a crash when we tried to
register a callback on it.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b03078d9a2d8a598c608afff677146bb91925d22
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:03 +0000 (07:24 +0100)]
author: Michel Pollet [Fri, 24 Jul 2015 15:24:22 +0000 (16:24 +0100)]
Message:
cores: Mega 8/16/32 and PORTA

Still register portA, regardless of PORTA constant initialisation

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 3f6bfcf379882a86b43d06965cfcfdd60076220b
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:03 +0000 (07:24 +0100)]
author: Michel Pollet [Fri, 24 Jul 2015 15:23:44 +0000 (16:23 +0100)]
Message:
cores: Gratuitous realignment

ODC got the better of me

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 599733f261f94317489c2cc8751fb84fd604e6fa
committer: Michel Pollet [Fri, 2 Oct 2015 06:24:03 +0000 (07:24 +0100)]
author: Michel Pollet [Tue, 14 Jul 2015 18:04:05 +0000 (19:04 +0100)]
Message:
interrupts: Converted to use the standard fifo

There's already a standard way to make FIFO's, so converted the
interrupt code to use that.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 29a85763db634ae914e808714cd2b4c6e310bb66
committer: Michel Pollet [Thu, 1 Oct 2015 14:27:25 +0000 (15:27 +0100)]
author: Michel Pollet [Thu, 1 Oct 2015 14:07:54 +0000 (15:07 +0100)]
Message:
cores: Added support for mega324a / pa..

Support for the renamed SPI block, somehow my headers (debian) don't
have any definition of a second one, but, the macro /should/ support it
now.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 65dcb8859503dd85ebc251b16f5528cc8a180a3e
author: Michel Pollet [Thu, 20 Aug 2015 07:19:58 +0000 (08:19 +0100)]
Message:
Merge pull request #130 from TheCrazyT/twi_i2c_write_fix

Twi i2cwrite fix
Commit 47cb0b9b645c98578eb9ec3554cf5d63bdc8b2ab
committer: crazyt [Wed, 19 Aug 2015 16:33:14 +0000 (18:33 +0200)]
author: crazyt [Mon, 17 Aug 2015 16:59:01 +0000 (18:59 +0200)]
Message:
fix for wrong return value of i2c_write.
Commit f4a6e39f66bc52db512cdb8fc9541251d43e0346
author: TheCrazyT [Mon, 17 Aug 2015 16:21:47 +0000 (18:21 +0200)]
Message:
Merge pull request #1 from dougszumski/twi_delay_fix

twi: Remove start condition delay
Commit 6e6a04b2fa2c16099b8eb6365fa6915340dfb2a6
author: Michel Pollet [Tue, 28 Jul 2015 08:26:58 +0000 (09:26 +0100)]
Message:
Merge pull request #126 from ddaygold/typo

Fixed a typo in the manual
Commit 508c2ad011511cd128c51bad743c75a071abddf6
author: Peter Chinetti [Sun, 26 Jul 2015 21:45:58 +0000 (17:45 -0400)]
Message:
Fixed a typo in the manual
Commit 870409e33a54c13a6f79b6dc57e53852cf94440f
author: Michel Pollet [Wed, 22 Jul 2015 07:06:55 +0000 (08:06 +0100)]
Message:
Merge pull request #124 from frej/enable-adc-for-atiny13

cores: Add ADC to the ATtiny13
Commit e181f0e2b94c9c352100aa7a6aa851d66072a86e
committer: Frej Drejhammar [Sun, 19 Jul 2015 13:01:48 +0000 (15:01 +0200)]
author: Frej Drejhammar [Sun, 19 Jul 2015 12:58:31 +0000 (14:58 +0200)]
Message:
cores: Add ADC to the ATtiny13
Commit 2f88e72135a66727ff51e7bc5f93f87c8096cf9c
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 09:43:45 +0000 (10:43 +0100)]
Message:
gdb: Cleanup

Also make sure we mask of only 24 bits of the address, newer gdb use one
somehow..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b64300059875cfd053f321226348b340c5de97dc
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 09:42:50 +0000 (10:42 +0100)]
Message:
cores: Added TIMER2_COMPB to m2560

This was commented out, dunno why..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 95638c32fb24c716668443dcfa17454355ef3708
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 16 Jun 2015 18:06:10 +0000 (19:06 +0100)]
Message:
ihex: Streamlined implementation

Use ihex_read_chunk to implement ihex_read_file, and add a
ihex_free_chuncks for consistency sake

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit a865759ce131dd4829e77416a9f08c008f85aa0c
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 16 Jun 2015 18:05:21 +0000 (19:05 +0100)]
Message:
avr: Add a 'reset pc' that can be nonzero

This allows the AVR to soft reset into the bootloader for example.

A watchdog reset will re-run the bootloader with the correct flag.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit f4f3b71bb02d6a0c6755f392ed2c4fa3b6eb6d99
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 16 Jun 2015 18:04:19 +0000 (19:04 +0100)]
Message:
watchdog: Some cleanup

No functional changes

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 4a03f8606671e904845194ebf2edfc69b536820b
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 12:23:10 +0000 (13:23 +0100)]
Message:
hex: Supports offsets larger then 64/128KB

New segemnt type for loading atmega2560 bootloaders

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0eefa6bf3c57f71257d85813241aac994297a19c
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 10:50:00 +0000 (11:50 +0100)]
Message:
simduino: Simplified, made compatible with m2560

Allow testing on atmega256 bootloader too.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 9ad0d2655a71a0292f0c92e3060ddc5e4f327af1
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 10:48:54 +0000 (11:48 +0100)]
Message:
avr: Renamed special_* core fields

Added a 'custom' sub struct

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b702ace2e408e2ace0b2ae61ba17eb06840cf038
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sun, 14 Jun 2015 10:42:10 +0000 (11:42 +0100)]
Message:
Whitespaces at end of line removed..

Dunno how these came to be..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 49ccc009a9fe0eddee01a3df4eec89d426bede3c
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sat, 13 Jun 2015 20:27:35 +0000 (21:27 +0100)]
Message:
elf: Detect start address (for bootloaders)

Allows loading a bootloader ELF as well as .hex with the right starting
PC

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 6b0218ffb89bcba0e31fcfab73d5170eef794c1e
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sat, 13 Jun 2015 20:26:50 +0000 (21:26 +0100)]
Message:
vcd: Prevent crash when close() is called twice

flahs() wasn't checking for a valid file pointer

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 3a4fab8b693e4afca6e3b83ff7afc9e15bc56358
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 20:06:15 +0000 (21:06 +0100)]
Message:
interrupts: Redone the logic of delivery

Simplified a few expressions

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit e4b36b58d22d22da62a0bcd95755f7454df411cb
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 20:05:50 +0000 (21:05 +0100)]
Message:
interrupts: Now track pending and running states

Introduced two new IRQs  per vector; one to track pending, and one to
track running state. So you can see any latency issues.
Also introduced a global pending/running IRQ, so you can track issues if
your interrupts overrun etc.

It is reasonably transparent, and seems to have had little impact on the
rest of the code... Hooray for nice clean APIs!

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 02257499e62b4b5b5eb7a1652489910caf166e7b
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 20:01:26 +0000 (21:01 +0100)]
Message:
vcd: Increased limits

Turns out it's easy to reach 32 if you try hard enough!

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 871d22206df3a9aa47d888f88edc7dc784f12ad6
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 20:00:38 +0000 (21:00 +0100)]
Message:
twi: Revert to NO_STATE after a stop

Otherwise the interrupt might get re-triggered

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 01956ebee35cb81f4814003a3bf981c46ed6f93a
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 20:00:02 +0000 (21:00 +0100)]
Message:
adc: Removed spurious trace

Accidentally commited this earlier

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 400f588b041787347d2cb97e7026774d709ea35f
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Wed, 10 Jun 2015 16:03:44 +0000 (17:03 +0100)]
Message:
arduidiot: Further pinout tweaks for 256's

Endless tweaks

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 6d4c0283ee49a724d3294b142b671fdf6978c564
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 9 Jun 2015 13:56:37 +0000 (14:56 +0100)]
Message:
twi: Always release STOP bit

Seems some libraries assume this bit will autoclear, even if
the stop condition was not really called for.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit cb020ec7c820dfafea3026f6146e8b95d05d540c
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 2 Jun 2015 20:21:08 +0000 (21:21 +0100)]
Message:
adc: bit of reformating

No functional changes

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit e6a640f340dd07f3e34002f8efea3c1ffb280026
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Tue, 2 Jun 2015 15:36:37 +0000 (16:36 +0100)]
Message:
shared: Some more tweaks to arduidiot_pins

Added remaining 2560 pins

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 05dd87406cd48e83227a53a6ccaa24476e22c27a
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sat, 30 May 2015 09:16:26 +0000 (10:16 +0100)]
Message:
Small reformat of long lines

New screen format..

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit fb4bcf5bebaefa7e2c1b5ee6d1ce4d3fc5afe828
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Sat, 30 May 2015 09:15:41 +0000 (10:15 +0100)]
Message:
simavr: Fixed mega250 pinouts for arduidiots

Referenced their headers

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 34fa73c4851fe59dc165aceafc36b2e791274e1a
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:54 +0000 (19:02 +0100)]
author: Michel Pollet [Fri, 29 May 2015 20:40:57 +0000 (21:40 +0100)]
Message:
uart_pty: Added a flush timer

Makes sure the FIFO gets a chance to be cleared after a XOFF

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 99e7355f60a14e413d5d9c2e8f9b7f6735737911
committer: Michel Pollet [Thu, 2 Jul 2015 18:02:53 +0000 (19:02 +0100)]
author: Michel Pollet [Fri, 29 May 2015 20:40:19 +0000 (21:40 +0100)]
Message:
arduidiot_pins: Added mega2560

And added a few utilitarian macros.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 41e6de82039367d9accff3e53948f40752c07163
author: Michel Pollet [Fri, 29 May 2015 20:36:26 +0000 (21:36 +0100)]
Message:
Merge pull request #121 from guyzmo/improved_osx_support

added support for MacOSX homebrew
Commit acd6232d387d87a39f10143f819d0106c0020b6e
committer: Bernard `Guyzmo` Pratz [Fri, 29 May 2015 20:26:59 +0000 (21:26 +0100)]
author: Bernard `Guyzmo` Pratz [Fri, 29 May 2015 19:46:33 +0000 (20:46 +0100)]
Message:
added support for MacOSX homebrew

Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github@m0g.net>
Commit 8075bc3a89bd1eec23a913ffe0c14b715f870251
author: Michel Pollet [Mon, 18 May 2015 09:20:13 +0000 (10:20 +0100)]
Message:
Merge pull request #120 from frej/avoid-buffer-overrun

Avoid buffer overrun on smaller AVRs
Commit f4a289091ee226cb9a323e2b2796ba706c2fc149
committer: Frej Drejhammar [Sun, 17 May 2015 15:10:22 +0000 (17:10 +0200)]
author: Frej Drejhammar [Sun, 17 May 2015 14:34:49 +0000 (16:34 +0200)]
Message:
Avoid buffer overrun on smaller AVRs

On smaller AVRs, such as the attiny13, MAX_IOs will be larger than the
size of SRAM which will lead to out of range writes to a malloc
allocated buffer. Therefore limit the number of bytes cleared to the
size of SRAM.
Commit f1e25444a7b407f46107320953fc85048b744d31
author: Michel Pollet [Mon, 27 Apr 2015 07:45:27 +0000 (08:45 +0100)]
Message:
Merge pull request #119 from bsekisser/bsekisser-adc-initfix

adc: check r_adcsrb is valid before init
Commit f65ac1a207cc940757cd33dc05346adb7a9c60b9
committer: bsekisser [Sun, 26 Apr 2015 12:42:30 +0000 (08:42 -0400)]
author: bsekisser [Sun, 26 Apr 2015 12:34:36 +0000 (08:34 -0400)]
Message:
adc: check r_adcsrb is valid before init

fix issue #118

modified:   simavr/sim/avr_adc.c
Commit 1f3f065461e974584be4d42f33f5a2789cf0d3d4
author: Michel Pollet [Wed, 22 Apr 2015 08:35:36 +0000 (09:35 +0100)]
Message:
Merge pull request #117 from bsekisser/bsekisser-flash-writefix

flash: be sure to use current page for writing
Commit 77e3f7846e0ff3c1e1f61f20bcda39a29c671b10
committer: bsekisser [Sat, 18 Apr 2015 12:18:18 +0000 (08:18 -0400)]
author: bsekisser [Sat, 18 Apr 2015 12:11:22 +0000 (08:11 -0400)]
Message:
flash: be sure to use current page for writing

bound z to ~(page size - 1), otherwise write may start at anywhere in page to write and fail.

also corrected log line to previous state as was missleading/inacurate.

modified:   simavr/sim/avr_flash.c
Commit 74a05db0b65e1f2e583b8f015814976572f332a5
author: Michel Pollet [Thu, 9 Apr 2015 20:29:19 +0000 (21:29 +0100)]
Message:
lin: Don't reset regs at init time

the reset handler does it

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 3c2839b50928e0abe64db218b5b077b799624fd1
author: Michel Pollet [Thu, 9 Apr 2015 20:28:51 +0000 (21:28 +0100)]
Message:
lin: Checked a divide by zero condition

As it turn out, static analizer doesn't know lbt is >= 8. Added a
comment there all same for anyon else reading this.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit e86d9e52075e2edd37fe497b0d11a2df3fd1df31
author: Michel Pollet [Thu, 9 Apr 2015 20:27:56 +0000 (21:27 +0100)]
Message:
ioport: Don't deref NULL on bad param

that ioctl requires a parameter, but doesn't check it. Static analyzer
doesn't like that at all.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 0f6f5c45078ead21ae142b034f09f1efaee37817
author: Michel Pollet [Wed, 8 Apr 2015 08:51:18 +0000 (09:51 +0100)]
Message:
Merge pull request #96 from bsekisser/bsekisser-master-core-remove-bclr-bset

core: Removal of duplicate code...
Commit 33c47992026357e1c48540f6009a904e4da0f363
author: Michel Pollet [Mon, 16 Feb 2015 21:05:33 +0000 (21:05 +0000)]
Message:
Merge pull request #110 from cskarai/fix-optiboot-watchdog

Optiboot bootloader unintentionally enables watchdog
Commit f73a44a589953482ad704f3e8dd5d08599e47c4e
author: Michel Pollet [Mon, 16 Feb 2015 21:05:04 +0000 (21:05 +0000)]
Message:
Merge pull request #114 from xqms/atmega2560_uart3

Support IO register addresses >= 256
Commit dfd97a7a7d9f8d1de1716f84174212c3760493e4
committer: Max Schwarz [Fri, 6 Feb 2015 00:06:04 +0000 (01:06 +0100)]
author: Max Schwarz [Thu, 5 Feb 2015 22:26:45 +0000 (23:26 +0100)]
Message:
sim_avr.h: increase MAX_IOs by one to 280

ATmega2560 has UDR0 at 0x136 = 310
Commit f4d247822cc09a3be6e4b5ac032313f23372128a
committer: Max Schwarz [Fri, 6 Feb 2015 00:06:04 +0000 (01:06 +0100)]
author: Max Schwarz [Thu, 5 Feb 2015 22:18:26 +0000 (23:18 +0100)]
Message:
sim_core + sim_regbit: use 16 bit integers for IO addresses

This is necessary on the larger ATmegas (e.g. ATmega2560).
Commit 62db05d8ec93d990209b1595b427e2f0dc208ead
committer: Max Schwarz [Thu, 5 Feb 2015 23:57:41 +0000 (00:57 +0100)]
author: Max Schwarz [Thu, 5 Feb 2015 22:17:25 +0000 (23:17 +0100)]
Message:
sim_core: don't hardcode max io register address, use MAX_IOs
Commit 7d47dbc73f68ad413fe661a0e88f19c0e8e5df70
committer: Max Schwarz [Thu, 5 Feb 2015 23:57:41 +0000 (00:57 +0100)]
author: Max Schwarz [Thu, 5 Feb 2015 23:56:56 +0000 (00:56 +0100)]
Message:
add unit test for UART3 echo on ATmega2560

This fails currently because IO addresses >= 256 are not handled correctly
in the core.
Commit 1e50f3c6d6bd381602bf3e72b986c3454a1f0d43
author: Michel Pollet [Mon, 19 Jan 2015 18:33:17 +0000 (18:33 +0000)]
Message:
Merge pull request #112 from cskarai/fix-timer-ocra-top

Reconfigure fast pwm timer at OCRA write  if OCRA is the top
Commit 275353445c0a16086db9c66cfe8f55b97c6f0cdc
author: Michel Pollet [Mon, 19 Jan 2015 18:32:40 +0000 (18:32 +0000)]
Message:
Merge pull request #111 from cskarai/fix-adc-adate

Implemented: ADC free running mode
Commit 948bbf97657d91dfac0a8d899e378f29abcdf9b5
author: cskarai [Wed, 7 Jan 2015 22:21:23 +0000 (23:21 +0100)]
Message:
Reconfigure fast pwm timer at OCRA write  if OCRA is the top
Commit 37ce96c3d2d68b1216179fe5e5466c920faef1fd
author: cskarai [Wed, 7 Jan 2015 19:39:47 +0000 (20:39 +0100)]
Message:
Fixed: issue with indentation
Commit 70cd616a05fe8333827d569cd5843c81105b8559
author: cskarai [Tue, 6 Jan 2015 21:13:40 +0000 (22:13 +0100)]
Message:
Added: free_running autotrigger mode
Commit 8636d5ec8b8c66a1d46dc87681e66df5e5b452d9
author: cskarai [Tue, 6 Jan 2015 20:32:01 +0000 (21:32 +0100)]
Message:
Added: ADC trigger sources
Commit 91259f9096689f9caac0faa4c23ca132082b12b6
committer: cskarai [Mon, 5 Jan 2015 18:36:36 +0000 (19:36 +0100)]
author: Karai Csaba [Sun, 4 Jan 2015 09:15:35 +0000 (10:15 +0100)]
Message:
Fixed: optiboot issue, watchdog is unintentionally enabled
Commit 81b78e08b96c795fa8bce83523526c6b09f822b5
author: Michel Pollet [Wed, 19 Nov 2014 09:23:43 +0000 (09:23 +0000)]
Message:
Merge pull request #101 from dougszumski/mx_core_add_extint

cores: Adds missing external interrupt for m16/m32
Commit 89763e57eb96b72be486b0db6fb37730329b9bbc
author: Michel Pollet [Wed, 5 Nov 2014 08:04:14 +0000 (08:04 +0000)]
Message:
Merge pull request #103 from distributed/dispatch

sim_io: do not overwrite _avr_io_mux_write in avr_register_io_write
Commit 495d2a92b956618bc17e7844d4643e6b6c177dcc
author: Michael Meier [Mon, 3 Nov 2014 20:37:22 +0000 (21:37 +0100)]
Message:
do not overwrite _avr_io_mux_write in avr_register_io_write
Commit d964ebc6a7fe5bc43c1b83daff2246c97632b220
author: Michel Pollet [Fri, 31 Oct 2014 20:44:46 +0000 (20:44 +0000)]
Message:
Merge pull request #98 from bsekisser/bsekisser-watchdog-software-reset

watchdog: reworked to add support for software reset.
Commit a10d508fb1a7d9394fbab16082be56eead3ad81b
committer: bsekisser [Fri, 31 Oct 2014 12:47:23 +0000 (08:47 -0400)]
author: bsekisser [Mon, 20 Oct 2014 07:48:55 +0000 (03:48 -0400)]
Message:
watchdog: reworked to add support for software reset.

support for software reset due to watchdog timeout...
based on watchdog documentation.

modified:   sim/sim_avr.c
modifications to avr_reset and avr_init to support software
reset.

modified:   sim/sim_avr.h
added type avr_run_t...
avr_t.run updated accordingly.

modified:   sim/avr_watchdog.c
largely rewritten to support software reset.

modified:   sim/avr_watchdog.h
data record 'reset_context' added to support software reset

modified:   sim/sim_regbit.h
added: avr_regbit_from_value
for checking flags before commiting register value.
added: avr_regbit_set_array_from_value
reverse operation of avr_regbit_get_array
Commit d85051ad32b13e26be2e5813c657147ca1a36eba
author: Michel Pollet [Thu, 30 Oct 2014 15:12:41 +0000 (15:12 +0000)]
Message:
Merge pull request #95 from bsekisser/master-core-run-many-limited-interrupt-state

interrupts: modify handling of interrupt state
Commit 6c6b0835db5a29f7083e8e582711a684f18ae5c6
author: Doug Szumski [Mon, 27 Oct 2014 20:45:44 +0000 (21:45 +0100)]
Message:
twi: Remove start condition delay

  > This corrects a problem where a non-interrupt driven twi driver
    functions on the target (m32) but not in simavr.
  > This also fixes ../examples/board_i2ctest so that it functions as
    expected.
Commit f9cb085cd1f9a96405971a909ffa29d6b534d026
committer: Doug Szumski [Fri, 24 Oct 2014 09:18:12 +0000 (11:18 +0200)]
author: Doug Szumski [Tue, 21 Oct 2014 20:14:48 +0000 (22:14 +0200)]
Message:
cores: Adds missing external interrupt for m16/m32

 > Async external interrupt (INT2) was missing on m16/32. Since unlike the others
   this interrupt uses only 1 bit for sense control avr_extint.* were modified to
   support this new mode.
Commit 5e6256ae3c88c2a672d570ff1baf22d7142f5740
committer: bsekisser [Wed, 22 Oct 2014 22:47:27 +0000 (18:47 -0400)]
author: bsekisser [Wed, 17 Sep 2014 19:31:38 +0000 (15:31 -0400)]
Message:
interrupts: modify handling of interrupt state

Interrupt state edge detection and wait states combined into multi
function variable, enabling the removal of edge detection
code in the run loop and simplifying need to service interrupts
by placing the burden on code directly influencing the interrupt
handling state.

modified:   simavr/sim/sim_avr.c
edge detection code removed from both run loops.
raw (non-gdb) loop does precheck of interrupt state, while not
necessary, potentially saving a few cycles.

modified:   simavr/sim/sim_avr.h
uint8_t i_shadow changed to int8_t interrupt_state.

modified:   simavr/sim/sim_core.c
flag changes which may impact interrupt state are routed
through avr_sreg_set().
multi-cycle loop simplified to check avr->interrupt_state.

modified:   simavr/sim/sim_core.h
static inline avr_sreg_set() - handles changes to global
interrupt state and ensures wait states if I
flag changes from 0 -> 1.  superfluous 1 -> 1
states are ignored, should they occur. and
disabling interrupts clears avr->interrupt_state.
flag changes from SET_SREG_FROM routed to avr_sreg_set();

modified:   simavr/sim/sim_interrupts.c
avr_interrupt_reset()
interrupt_state cleared during reset.
avr_raise_intrrupt()
check interrupts enabled and no pending
interrupt_state before marking pending interrupt state.
avr_service_interrupts()
servicing code changed to tick pending wait state then
mark for any pending interrupts or set to zero
if none waiting.
on interrupt, direct interrupt state change to
avr_sreg_set();

modified:   simavr/sim/sim_interrupts.h
remove pending_wait.

modified:   tests/tests.c
interrupt edge dectection code removed from test run loop.
no further modifications required.

modified:   simavr/sim/sim_avr.c
modified:   simavr/sim/sim_avr.h
modified:   simavr/sim/sim_core.c
modified:   simavr/sim/sim_core.h
modified:   simavr/sim/sim_interrupts.c
modified:   simavr/sim/sim_interrupts.h
modified:   tests/tests.c
Commit 0428233dbfec25fe56a8189b2e8f7e6fb61189ff
author: Michel Pollet [Mon, 20 Oct 2014 20:54:13 +0000 (21:54 +0100)]
Message:
Merge pull request #100 from bsekisser/bsekisser-cores-spi-declare

cores: add spi declaration
Commit 4025318a43375f03600d12582bf451c02213ffa9
author: Michel Pollet [Mon, 20 Oct 2014 20:53:53 +0000 (21:53 +0100)]
Message:
Merge pull request #99 from bsekisser/bsekisser-cores-ioport-declare

cores: AVR_IOPORT_DECLARE
Commit e175b0fd73521fd7acea6267bfe023a407f31da4
committer: bsekisser [Mon, 20 Oct 2014 18:29:00 +0000 (14:29 -0400)]
author: bsekisser [Mon, 20 Oct 2014 18:06:49 +0000 (14:06 -0400)]
Message:
cores: add spi declaration

convert spi structure definitions to AVR_SPI_DECLARE

modified:   simavr/cores/sim_90usb162.c
modified:   simavr/cores/sim_mega128.c
modified:   simavr/cores/sim_mega1280.c
modified:   simavr/cores/sim_mega1281.c
modified:   simavr/cores/sim_mega128rfr2.c
modified:   simavr/cores/sim_mega169.c
modified:   simavr/cores/sim_mega2560.c
modified:   simavr/cores/sim_megax.h
modified:   simavr/cores/sim_megax4.h
modified:   simavr/cores/sim_megax8.h
modified:   simavr/cores/sim_megaxm1.h
modified:   simavr/sim/avr_spi.h
Commit 4bcb2928292b02f41ce989b113bd97d8c0b5d861
author: bsekisser [Mon, 20 Oct 2014 15:34:16 +0000 (11:34 -0400)]
Message:
cores: AVR_IOPORT_DECLARE

convert port sructure declarations to macro AVR_IOPORT_DECLARE.

modified:   simavr/cores/sim_90usb162.c
modified:   simavr/cores/sim_mega128.c
modified:   simavr/cores/sim_mega1280.c
modified:   simavr/cores/sim_mega1281.c
modified:   simavr/cores/sim_mega128rfa1.c
modified:   simavr/cores/sim_mega128rfr2.c
modified:   simavr/cores/sim_mega169.c
modified:   simavr/cores/sim_mega2560.c
modified:   simavr/cores/sim_megax.h
modified:   simavr/cores/sim_tiny2313.c
modified:   simavr/sim/avr_ioport.h
Commit 709a87bb91ba11c52ad83de3554522664f928d02
author: bsekisser [Fri, 17 Oct 2014 12:29:55 +0000 (08:29 -0400)]
Message:
core: Removal of duplicate code...

core contains two functionally equivalent blocks of code...  implimenting
cl?, se? and bclr, bset.   During operation the case code for
bclr and bset never get called, but as stated does not matter since
code at the top of the block performs the EXACT same function.
technically... using the case code SHOULD be the better performing
option...  at the moment though, neither one seems to exhibiting
any advantage over the other.

modified:   simavr/sim/sim_core.c
Commit 1a503bdcd0cc22a4f6b1149f6d63d1dc895fd5d4
author: Michel Pollet [Tue, 14 Oct 2014 17:53:10 +0000 (18:53 +0100)]
Message:
tests: Fix makefile

Was using ${OBJ} before it was declared.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit 93b1468d25acc10a3409a75a8aaaca22302e0d52
author: Michel Pollet [Tue, 14 Oct 2014 17:51:26 +0000 (18:51 +0100)]
Message:
build: fix build of libsimavr.so

Was being linked with itself. Newer gcc are not amused.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit b5cdf931f2305dbddc4008879f81e1a3cb4c74ed
committer: Michel Pollet [Tue, 14 Oct 2014 17:44:48 +0000 (18:44 +0100)]
author: Michel Pollet [Tue, 14 Oct 2014 17:44:24 +0000 (18:44 +0100)]
Message:
build: re-accelerated the build

Simavr used to build pretty quick, and it's been crawling for a while
now, turns out some of the enhancements we added to the SIMAVR path
detection were being evaluated a LOT.
So went to the makefile and made sure most of the static variables are
evaluated once only.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Commit eb45f55a54cdd31cb12a778d7b6baebe032287a2
author: Michel Pollet [Tue, 14 Oct 2014 17:39:22 +0000 (18:39 +0100)]
Message:
Merge pull request #94 from hedrok/master

Timer simulation fixes and improvements
Commit 59720c375151cc4cedd3487bb826f47b19b59e58
author: Michel Pollet [Tue, 14 Oct 2014 17:37:10 +0000 (18:37 +0100)]
Message:
Merge pull request #92 from cyrozap/master

Fix the issue where Intel HEX files with hex strings longer than 32 bytes would be truncated
Commit aba71d87d60b9d94456da63f8e1c2f98d526f01a
author: Michel Pollet [Tue, 14 Oct 2014 17:35:41 +0000 (18:35 +0100)]
Message:
Merge pull request #83 from bsekisser/master-core-run-many-limited

Changes to allow for free run in core between cycle timers
Commit acdad6ef0a02b502f286a3f2995b1b8b4aba0628
author: Michel Pollet [Tue, 14 Oct 2014 17:34:22 +0000 (18:34 +0100)]
Message:
Merge pull request #82 from dougszumski/i2c_test_extension

examples: Extends i2ctest to include a second TWI driver