X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Fflash_at91.h;h=a706e5e5d10a8c4d2e431170e809d5dc89f67702;hb=f5836fc506729b54921d5514f74a99706fda0f7f;hp=0b6c8d663676d7a3be29c69550bed5709fe7cee0;hpb=2302be36b228a46292a3f4eae649f5e29bd9999c;p=bertos.git diff --git a/bertos/cpu/arm/drv/flash_at91.h b/bertos/cpu/arm/drv/flash_at91.h index 0b6c8d66..a706e5e5 100644 --- a/bertos/cpu/arm/drv/flash_at91.h +++ b/bertos/cpu/arm/drv/flash_at91.h @@ -40,66 +40,13 @@ #ifndef FLASH_AT91_H #define FLASH_AT91_H -#include +#include "cfg/cfg_emb_flash.h" -#include +#if !CONFIG_FLASH_DISABLE_OLD_API -#include - - -#define FLASH_PAGE_SIZE FLASH_PAGE_SIZE_BYTES - -/** - * Define data type to manage page and memory address. - */ -typedef uint32_t page_t; -typedef uint32_t page_addr_t; - -struct Flash; - -/** - * FlashAt91 KFile context structure. - * - * DEPREACTED STRUCTURE! - * Use EmbFlash instead - * - * \{ - */ -typedef struct FlashAt91 -{ - /** - * File descriptor. - */ - KFile fd; - - /** - * Flag for checking if current page is modified. - */ - bool page_dirty; - - /** - * Current buffered page. - */ - page_t curr_page; - - /** - * Temporary buffer cointaing data block to - * write on flash. - */ - uint8_t page_buf[FLASH_PAGE_SIZE_BYTES]; -} FlashAt91; -/* \} */ - -void flash_hw_init(struct Flash *fd); - -/** - * WARNING! - * This function is DEPRECADED! - * use the emb_flash module instead. - */ -INLINE void flash_at91_init(struct FlashAt91 *fd) -{ - flash_hw_init((struct Flash *)fd); -} + /* For backwards compatibility */ + #define FlashAt91 Flash + #define flash_at91_init(fls) flash_init(fls); +#endif /* !CONFIG_FLASH_DISABLE_OLD_API */ #endif /* DRV_FLASH_ARM_H */