X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Favr%2Fdrv%2Fflash_avr.h;h=b75a38b8b3ef1f80654116b8a0dbd0865abc1566;hb=da99e878a65f6ab84e51bdf4c9029c3906431b03;hp=c64fc699b34019d40d1163be810d999672fa8268;hpb=dd6db266344e7bf6d58673d7ce5b5b3a9ed9e64d;p=bertos.git diff --git a/bertos/cpu/avr/drv/flash_avr.h b/bertos/cpu/avr/drv/flash_avr.h index c64fc699..b75a38b8 100644 --- a/bertos/cpu/avr/drv/flash_avr.h +++ b/bertos/cpu/avr/drv/flash_avr.h @@ -30,47 +30,22 @@ * * --> * - * \brief Self programming routines (interface). - * - * \version $Id$ * \author Francesco Sacchi * \author Daniele Basile + * + * \brief AVR Internal flash read/write driver. */ -#ifndef DRV_FLASH_AVR_H -#define DRV_FLASH_AVR_H - -#include -#include - - -/** - * FlashAvr KFile context structure. - */ -typedef struct KFileFlashAvr -{ - KFile fd; ///< File descriptor. -} KFileFlashAvr; - - - -/** - * ID for FlashAvr - */ -#define KFT_FLASHAVR MAKE_ID('F', 'L', 'A', 'V') - -/** - * Convert + ASSERT from generic KFile to KFileFlashAvr. - */ -INLINE KFileFlashAvr * KFILEFLASHAVR(KFile *fd) -{ - ASSERT(fd->_type == KFT_FLASHAVR); - return (KFileFlashAvr *)fd; -} - +#ifndef FLASH_AVR_H +#define FLASH_AVR_H -void flash_avr_init(struct KFile *fd); +#include "cfg/cfg_emb_flash.h" +#if !CONFIG_FLASH_DISABLE_OLD_API + /* 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 */