Rev 361 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 361 | andfri | 1 | #ifndef FLASH_H_ |
| 2 | #define FLASH_H_ |
||
| 3 | |||
| 4 | #define BOOTLOADER __attribute__ ((section (".bootloader"))) |
||
| 5 | #define FLASH_CODE __attribute__ ((section (".flash_code"))) |
||
| 6 | |||
| 7 | //--------------------------------------------------------------------------- |
||
| 8 | // Function prototypes for flash modifying functions |
||
| 9 | |||
| 10 | // Only flash_flush_buffer uses the spm instruction and has to be in the |
||
| 11 | // .bootloader section, but there is room for the other functions which |
||
| 12 | // would otherwise use space in .text. |
||
| 13 | void flash_init(uint8_t* buf) BOOTLOADER; |
||
| 14 | void flash_write_word(uint16_t addr, uint16_t word) BOOTLOADER; |
||
| 15 | void flash_flush_buffer(void) BOOTLOADER; |
||
| 16 | // Tell gcc that flash_copy_data never returns, so it can be further optimized. |
||
| 17 | void flash_copy_data(uint16_t src, uint16_t dst, uint16_t len) __attribute__ ((noreturn)) FLASH_CODE; |
||
| 18 | |||
| 19 | #endif /*FLASH_H_*/ |