bootloader.h
00001 #ifndef __AVR_BOOTLOADER_H__
00002 #define __AVR_BOOTLOADER_H__
00003
00004 #include <inttypes.h>
00005 #include <avr/io.h>
00006 #include <stdbool.h>
00007
00008 #define ATTR_INIT_SECTION(SectionIndex) __attribute__ ((naked, section (".init" #SectionIndex )))
00009 #define ATTR_NO_INIT __attribute__ ((section (".noinit")))
00010
00011 #ifndef BOOTLOADER_SEC_SIZE_BYTES
00012 #define BOOTLOADER_SEC_SIZE_BYTES (0x1000)
00013 #endif
00014
00015 #ifndef BOOTLOADER_START_ADDRESS
00016 #define BOOTLOADER_START_ADDRESS (FLASHEND-BOOTLOADER_SEC_SIZE_BYTES+1)
00017 #endif
00018
00019 #define MAGIC_BOOT_KEY 0xDC42ACCA
00020
00021 extern void Jump_To_Bootloader(void);
00022 extern bool bootloader_is_present(void);
00023
00024 #endif