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>
io: No functional changes
Just reformating
Signed-off-by: Michel Pollet <buserror@gmail.com>
timer: Added a selective trace option
Allows tracing one timer only
Signed-off-by: Michel Pollet <buserror@gmail.com>
arduidio: Simplified pin mapping
Again...
Signed-off-by: Michel Pollet <buserror@gmail.com>
timers: Gratuitous realignment
Go on with the new, improved narrow codestyle
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
cores: Mega 8/16/32 and PORTA
Still register portA, regardless of PORTA constant initialisation
Signed-off-by: Michel Pollet <buserror@gmail.com>
cores: Gratuitous realignment
ODC got the better of me
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
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>
io: No functional changes
Just reformating
Signed-off-by: Michel Pollet <buserror@gmail.com>
timer: Added a selective trace option
Allows tracing one timer only
Signed-off-by: Michel Pollet <buserror@gmail.com>
arduidio: Simplified pin mapping
Again...
Signed-off-by: Michel Pollet <buserror@gmail.com>
Merge pull request #130 from TheCrazyT/twi_i2c_write_fix
Twi i2cwrite fix
fix for wrong return value of i2c_write.
Merge pull request #1 from dougszumski/twi_delay_fix
twi: Remove start condition delay
Merge pull request #126 from ddaygold/typo
Fixed a typo in the manual
Fixed a typo in the manual
timers: Gratuitous realignment
Go on with the new, improved narrow codestyle
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
cores: Mega 8/16/32 and PORTA
Still register portA, regardless of PORTA constant initialisation
Signed-off-by: Michel Pollet <buserror@gmail.com>
cores: Gratuitous realignment
ODC got the better of me
Signed-off-by: Michel Pollet <buserror@gmail.com>
Merge pull request #124 from frej/enable-adc-for-atiny13
cores: Add ADC to the ATtiny13
cores: Add ADC to the ATtiny13
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>
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>
cores: Added TIMER2_COMPB to m2560
This was commented out, dunno why..
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
watchdog: Some cleanup
No functional changes
Signed-off-by: Michel Pollet <buserror@gmail.com>
hex: Supports offsets larger then 64/128KB
New segemnt type for loading atmega2560 bootloaders
Signed-off-by: Michel Pollet <buserror@gmail.com>
simduino: Simplified, made compatible with m2560
Allow testing on atmega256 bootloader too.
Signed-off-by: Michel Pollet <buserror@gmail.com>
avr: Renamed special_* core fields
Added a 'custom' sub struct
Signed-off-by: Michel Pollet <buserror@gmail.com>
Whitespaces at end of line removed..
Dunno how these came to be..
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
interrupts: Redone the logic of delivery
Simplified a few expressions
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
vcd: Increased limits
Turns out it's easy to reach 32 if you try hard enough!
Signed-off-by: Michel Pollet <buserror@gmail.com>
twi: Revert to NO_STATE after a stop
Otherwise the interrupt might get re-triggered
Signed-off-by: Michel Pollet <buserror@gmail.com>
adc: Removed spurious trace
Accidentally commited this earlier
Signed-off-by: Michel Pollet <buserror@gmail.com>
arduidiot: Further pinout tweaks for 256's
Endless tweaks
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
adc: bit of reformating
No functional changes
Signed-off-by: Michel Pollet <buserror@gmail.com>
shared: Some more tweaks to arduidiot_pins
Added remaining 2560 pins
Signed-off-by: Michel Pollet <buserror@gmail.com>
Small reformat of long lines
New screen format..
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr: Fixed mega250 pinouts for arduidiots
Referenced their headers
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
arduidiot_pins: Added mega2560
And added a few utilitarian macros.
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
watchdog: Some cleanup
No functional changes
Signed-off-by: Michel Pollet <buserror@gmail.com>
hex: Supports offsets larger then 64/128KB
New segemnt type for loading atmega2560 bootloaders
Signed-off-by: Michel Pollet <buserror@gmail.com>
simduino: Simplified, made compatible with m2560
Allow testing on atmega256 bootloader too.
Signed-off-by: Michel Pollet <buserror@gmail.com>
avr: Renamed special_* core fields
Added a 'custom' sub struct
Signed-off-by: Michel Pollet <buserror@gmail.com>
Whitespaces at end of line removed..
Dunno how these came to be..
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
interrupts: Redone the logic of delivery
Simplified a few expressions
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
vcd: Increased limits
Turns out it's easy to reach 32 if you try hard enough!
Signed-off-by: Michel Pollet <buserror@gmail.com>
twi: Revert to NO_STATE after a stop
Otherwise the interrupt might get re-triggered
Signed-off-by: Michel Pollet <buserror@gmail.com>
adc: Removed spurious trace
Accidentally commited this earlier
Signed-off-by: Michel Pollet <buserror@gmail.com>
arduidiot: Further pinout tweaks for 256's
Endless tweaks
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
adc: bit of reformating
No functional changes
Signed-off-by: Michel Pollet <buserror@gmail.com>
shared: Some more tweaks to arduidiot_pins
Added remaining 2560 pins
Signed-off-by: Michel Pollet <buserror@gmail.com>
Small reformat of long lines
New screen format..
Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr: Fixed mega250 pinouts for arduidiots
Referenced their headers
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
arduidiot_pins: Added mega2560
And added a few utilitarian macros.
Signed-off-by: Michel Pollet <buserror@gmail.com>
Merge pull request #121 from guyzmo/improved_osx_support
added support for MacOSX homebrew
added support for MacOSX homebrew
Signed-off-by: Bernard `Guyzmo` Pratz <guyzmo+github@m0g.net>
Merge pull request #120 from frej/avoid-buffer-overrun
Avoid buffer overrun on smaller AVRs
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.
Merge pull request #119 from bsekisser/bsekisser-adc-initfix
adc: check r_adcsrb is valid before init
adc: check r_adcsrb is valid before init
fix issue #118
modified: simavr/sim/avr_adc.c
Merge pull request #117 from bsekisser/bsekisser-flash-writefix
flash: be sure to use current page for writing
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
lin: Don't reset regs at init time
the reset handler does it
Signed-off-by: Michel Pollet <buserror@gmail.com>
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>
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>
Merge pull request #96 from bsekisser/bsekisser-master-core-remove-bclr-bset
core: Removal of duplicate code...
Merge pull request #110 from cskarai/fix-optiboot-watchdog
Optiboot bootloader unintentionally enables watchdog
Merge pull request #114 from xqms/atmega2560_uart3
Support IO register addresses >= 256
sim_avr.h: increase MAX_IOs by one to 280
ATmega2560 has UDR0 at 0x136 = 310
sim_core + sim_regbit: use 16 bit integers for IO addresses
This is necessary on the larger ATmegas (e.g. ATmega2560).
sim_core: don't hardcode max io register address, use MAX_IOs
add unit test for UART3 echo on ATmega2560
This fails currently because IO addresses >= 256 are not handled correctly
in the core.
Merge pull request #112 from cskarai/fix-timer-ocra-top
Reconfigure fast pwm timer at OCRA write if OCRA is the top
Merge pull request #111 from cskarai/fix-adc-adate
Implemented: ADC free running mode
Reconfigure fast pwm timer at OCRA write if OCRA is the top
Fixed: issue with indentation
Added: free_running autotrigger mode
Added: ADC trigger sources
Fixed: optiboot issue, watchdog is unintentionally enabled
Merge pull request #101 from dougszumski/mx_core_add_extint
cores: Adds missing external interrupt for m16/m32