Commit Graph

23 Commits

Author SHA1 Message Date
Olaf Rempel fc61d39288 Do not use IRQs and remove vector table
Do not use ISRs and poll for interrupt flags in the main loop.
No need for moving vector table into bootloader and back.

Remove vector table by adding LDFLAGS = -nostartfiles.
Manually add some code which is now removed, but still needed by C
runtime:
- make sure that r1 is 0x00 (zero register).
- on some MCUs the stack pointer is not initialized correctly after
reset.
- main() need to be placed in special section .init9 to be called at all.

Not sure why the BSS and DATA segment are still initialized.

This change is heavily based on the optiboot bootloader.
2019-11-06 13:18:53 +01:00
Olaf Rempel b60a0fe735 Simplify ACK handling
TWEA bit in TWCR register needs to be cleared to send NACK.
Clear it when too many bytes were received, re-enable it after
when going idle.

Add missing state for prev. send NACK.
Catch all invalid states and reset bus.

TWINT bit needs to be set every time in ISR.
2019-11-06 13:18:53 +01:00
Olaf Rempel eee017dedf Split TWI handling into read/write functions 2019-11-06 13:18:53 +01:00
Olaf Rempel 1418971648 Remove MCU type from version string 2019-11-06 13:18:53 +01:00
Olaf Rempel 5ba6367a37 Get signature bytes from system headers 2019-11-06 13:18:53 +01:00
Olaf Rempel f4ef7a7b1e Update code style
Update indention to spaces
Fix comments
Add README.md and GPL-2 LICENSE files
2019-11-06 13:18:53 +01:00
Jason Lefley f58adea5d6 fix comment to reflect changes in fuses 2015-03-24 11:13:57 -07:00
Olaf Rempel bc5d45359a Fix sizeof(VERSION_STRING)
- sizeof(info) should not be increased (16->18) since the size is never
  exchanged with the I2C master. Also using a non 2^x size will result
  in bigger code since the compiler can no longer use a simple AND to
  implement the bcnt %= sizeof(info).

- when using a info[16] the firmware is small enough to fit in a 512
  word bootloader again :)
2015-03-21 09:15:43 +01:00
Jason Lefley 89b3251dde add support for atmega328p 2015-03-18 15:28:12 -07:00
Olaf Rempel 5e4b562608 update Makefile 2014-10-05 14:32:07 +02:00
Olaf Rempel 9424e20ea7 add LED macros, bump version 2011-02-20 14:40:42 +01:00
Olaf Rempel 3acd88c11c add small timeout after exit 2010-10-17 18:24:12 +02:00
Olaf Rempel b16b660495 fix mega8 interrupt vector switch 2010-10-17 18:23:41 +02:00
Olaf Rempel 8a98e09c46 corrections 2010-10-16 19:28:05 +02:00
Olaf Rempel b2c6dc35ce flag eeprom support 2010-08-15 17:01:06 +02:00
Olaf Rempel f73b52bc3c multicpu support 2010-08-15 16:44:54 +02:00
Olaf Rempel e013aea33c new protocol 2010-07-11 16:51:50 +02:00
Olaf Rempel 997af25bee disable watchdog after reset, reduce size 2008-06-21 15:40:44 +02:00
Olaf Rempel dbef89dc6e mega88 version 2008-06-17 18:02:07 +02:00
Olaf Rempel 96a79d970d fixed eeprom handling 2008-02-17 23:04:52 +01:00
Olaf Rempel b9595cca59 cleanups 2007-10-05 23:16:44 +02:00
Olaf Rempel 164ef6fefa secure writing with cookie 2007-09-24 10:32:51 +02:00
Olaf Rempel 914150f707 initial commit 2007-09-21 21:39:09 +02:00