hw_boot.h

Go to the documentation of this file.
00001 
00043 #ifndef HW_BOOT_H
00044 #define HW_BOOT_H
00045 
00046 #include <avr/io.h>
00047 
00048 /* Set up function pointer to RESET vector */
00049 void (*rom_start)(void) NORETURN = 0x0000;
00050 
00051 #define START_APP() rom_start()
00052 
00053 #define BOOT_INIT do \
00054 { \
00055     /* Enable change of Interrupt Vectors */ \
00056     MCUCR = BV(IVCE); \
00057     /* Move interrupts to boot Flash section */ \
00058     MCUCR = BV(IVSEL); \
00059 } while(0)
00060 
00061 #define BOOT_END do \
00062 { \
00063     /* Enable change of Interrupt Vectors */ \
00064     MCUCR = BV(IVCE); \
00065     /* Move interrupts to boot Flash section */ \
00066     MCUCR = 0; \
00067 } while(0)
00068 
00069 #endif // HW_BOOT_H
00070