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.
- 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 :)