Skip to content

Commit

Permalink
Support for ATmega2560
Browse files Browse the repository at this point in the history
- EIND=0 before exiting bootloader.
- Makefile defs for ATmega2560.
  • Loading branch information
ferhate committed Nov 19, 2018
1 parent 25d588a commit f97d496
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#------------------------------------------------------------------
# Change these defs for the target device

MCU_TARGET = atmega1284p # Target device to be used (32K or larger)
BOOT_ADR = 0x1F000 # Boot loader start address [byte] NOT [word] as in http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega1284p
MCU_TARGET = atmega2560 # Target device to be used (32K or larger)
BOOT_ADR = 0x3E000 # Boot loader start address [byte] NOT [word] as in http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega1284p
F_CPU = 16000000 # CPU clock frequency [Hz] NOT critical: it just should be higher than the actual Hz
SD_CS_PORT = PORTB # Data Register of the SD CS pin
SD_CS_DDR = DDRB # Data Direction Register of the SD CS pin
Expand Down
5 changes: 4 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ int main (void)

checkFile();

if (pgm_read_word(0) != 0xFFFF) ((void(*)(void))0)(); //EXIT BOOTLOADER
if (pgm_read_word(0) != 0xFFFF) {
EIND = 0;
((void(*)(void))0)(); //EXIT BOOTLOADER
}

#if USE_UART
UART_puts(PSTR("retry"));
Expand Down

0 comments on commit f97d496

Please sign in to comment.