Rev 299 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 299 | Rev 315 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | #define BOOTLOADER __attribute__ ((section (".bootloader"))) |
4 | #define BOOTLOADER __attribute__ ((section (".bootloader"))) |
| 5 | - | ||
| 6 | //#define FLASH_LOAD_BUFFER |
- | |
| 7 | //#define FLASH_COPY_DATA |
- | |
| 8 | #define |
5 | #define FLASH_CODE __attribute__ ((section (".flash_code"))) |
| 9 | 6 | ||
| 10 | //--------------------------------------------------------------------------- |
7 | //--------------------------------------------------------------------------- |
| 11 | // Function prototypes for flash modifying functions |
8 | // Function prototypes for flash modifying functions |
| 12 | 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( |
13 | void flash_init(uint8_t* buf) BOOTLOADER; |
| 14 | void flash_write_word(uint16_t addr, uint16_t word) BOOTLOADER; |
14 | void flash_write_word(uint16_t addr, uint16_t word) BOOTLOADER; |
| 15 | void flash_flush_buffer(void) BOOTLOADER; |
15 | void flash_flush_buffer(void) BOOTLOADER; |
| 16 | #ifdef FLASH_COPY_DATA |
- | |
| 17 |
|
16 | // Tell gcc that flash_copy_data never returns, so it can be further optimized. |
| 18 | #endif |
- | |
| 19 | #ifdef FLASH_COPY_DATA_NEW |
- | |
| 20 | void flash_copy_data(uint16_t src, uint16_t dst, uint16_t len) __attribute__ ((noreturn)) |
17 | void flash_copy_data(uint16_t src, uint16_t dst, uint16_t len) __attribute__ ((noreturn)) FLASH_CODE; |
| 21 | #endif |
- | |
| 22 | 18 | ||
| 23 | #endif /*FLASH_H_*/ |
19 | #endif /*FLASH_H_*/ |