X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Fflash_at91.h;h=a706e5e5d10a8c4d2e431170e809d5dc89f67702;hb=84d7581d4e99d656db0064086ecee8d9f30aeba3;hp=1dcd9829131d6a0b00c20ce5b9bdb687cb199fdd;hpb=507e95236d43b2aa6d6b6e46bde5cb92345ab034;p=bertos.git diff --git a/bertos/cpu/arm/drv/flash_at91.h b/bertos/cpu/arm/drv/flash_at91.h index 1dcd9829..a706e5e5 100644 --- a/bertos/cpu/arm/drv/flash_at91.h +++ b/bertos/cpu/arm/drv/flash_at91.h @@ -40,63 +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 + /* For backwards compatibility */ + #define FlashAt91 Flash + #define flash_at91_init(fls) flash_init(fls); +#endif /* !CONFIG_FLASH_DISABLE_OLD_API */ - -/** - * Define data type to manage page and memory address. - */ -typedef uint32_t arm_page_t; -typedef uint32_t arm_page_addr_t; - -/** - * FlashAt91 KFile context structure. - */ -typedef struct FlashAt91 -{ - /** - * File descriptor. - */ - KFile fd; - - /** - * Flag for checking if current page is modified. - */ - bool page_dirty; - - /** - * Current buffered page. - */ - arm_page_t curr_page; - - /** - * Temporary buffer cointaing data block to - * write on flash. - */ - uint8_t page_buf[FLASH_PAGE_SIZE_BYTES]; - - -} FlashAt91; - -/** - * ID for FlashAt91 - */ -#define KFT_FLASHAT91 MAKE_ID('F', 'A', '9', '1') - -/** - * Convert + ASSERT from generic KFile to FlashAt91. - */ -INLINE FlashAt91 * FLASHAT91_CAST(KFile *fd) -{ - ASSERT(fd->_type == KFT_FLASHAT91); - return (FlashAt91 *)fd; -} - - -void flash_at91_init(FlashAt91 *fd); - -#endif +#endif /* DRV_FLASH_ARM_H */