Subversion Repositories HomeAutomation

Rev

Rev 315 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 315 Rev 378
1
#ifndef FLASH_H_
1
#ifndef FLASH_H_
2
#define FLASH_H_
2
#define FLASH_H_
3
 
3
 
4
#define BOOTLOADER __attribute__ ((section (".bootloader")))
4
#define BOOTLOADER __attribute__ ((section (".bootloader")))
5
#define FLASH_CODE __attribute__ ((section (".flash_code")))
5
#define FLASH_CODE __attribute__ ((section (".flash_code")))
6
 
6
 
7
//---------------------------------------------------------------------------
7
//---------------------------------------------------------------------------
8
// Function prototypes for flash modifying functions
8
// Function prototypes for flash modifying functions
9
 
9
 
10
// Only flash_flush_buffer uses the spm instruction and has to be in the
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
11
// .bootloader section, but there is room for the other functions which
12
// would otherwise use space in .text.
12
// would otherwise use space in .text.
13
void flash_init(uint8_t* buf) BOOTLOADER;
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
// Tell gcc that flash_copy_data never returns, so it can be further optimized.
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;
17
void flash_copy_data(uint16_t src, uint16_t dst, uint16_t len) __attribute__ ((noreturn)) FLASH_CODE;
18
 
18
 
19
#endif /*FLASH_H_*/
19
#endif /*FLASH_H_*/
20
 
20