X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fflash_avr.h;h=b75a38b8b3ef1f80654116b8a0dbd0865abc1566;hb=4635e332d9a489cb54a25b1bf37559c84181db74;hp=6c06eaf345e95021da79811da003697a071a770b;hpb=2302be36b228a46292a3f4eae649f5e29bd9999c;p=bertos.git diff --git a/bertos/cpu/avr/drv/flash_avr.h b/bertos/cpu/avr/drv/flash_avr.h index 6c06eaf3..b75a38b8 100644 --- a/bertos/cpu/avr/drv/flash_avr.h +++ b/bertos/cpu/avr/drv/flash_avr.h @@ -34,74 +34,18 @@ * \author Daniele Basile * * \brief AVR Internal flash read/write driver. - * - * - */ - -#ifndef FLASH_AT91_H -#define FLASH_AT91_H - -#include - -#include - -#include - -#include - - -#define FLASH_PAGE_SIZE SPM_PAGESIZE - -/** - * Definition of type for avr flash module. - */ -typedef uint16_t page_t; - -/* Forward declaration */ -struct Flash; - -/** - * FlashAvr KFile context structure. - * DEPREACTED STRUCTURE! - * Use Flash instead - * - * \{ */ -typedef struct FlashAvr -{ - /** - * File descriptor. - */ - KFile fd; - - /** - * Flag for checking if current page is modified. - */ - bool page_dirty; - /** - * Current buffered page. - */ - page_t curr_page; +#ifndef FLASH_AVR_H +#define FLASH_AVR_H - /** - * Temporary buffer cointaing data block to - * write on flash. - */ - uint8_t page_buf[SPM_PAGESIZE]; -} FlashAvr; -/* \} */ +#include "cfg/cfg_emb_flash.h" -void flash_hw_init(struct Flash *fd); +#if !CONFIG_FLASH_DISABLE_OLD_API -/** - * WARNING! - * This function is DEPRECADED! - * use the flash module instead. - */ -INLINE void flash_avr_init(struct FlashAvr *fd) -{ - flash_hw_init((struct Flash *)fd); -} + /* For backwards compatibility */ + #define FlashAvr Flash + #define flash_avr_init(fls) flash_init(fls); +#endif /* !CONFIG_FLASH_DISABLE_OLD_API */ #endif /* DRV_FLASH_AVR_H */