X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fflash25.c;h=793fab019dc546c3c298f6d44b0dc5dd4a8d7fee;hb=9d38debd0d2b2eaeeeec7f82d7c39e749ac729e5;hp=70d9229a468f4db70e817e38b874c1eaeb947107;hpb=8cca97771bf57082616dde340005874812fb728a;p=bertos.git diff --git a/bertos/drv/flash25.c b/bertos/drv/flash25.c index 70d9229a..793fab01 100644 --- a/bertos/drv/flash25.c +++ b/bertos/drv/flash25.c @@ -27,10 +27,9 @@ * the GNU General Public License. * * Copyright 2007 Develer S.r.l. (http://www.develer.com/) - * * --> * - * \brief Function library for serial Flash memory. + * \brief Function library for serial Flash memory. * * Module provide a kfile interface, that ensure an abstraction * from comunication channel and give a standard interface. @@ -55,9 +54,7 @@ #include -#if CONFIG_KERNEL -#include -#endif +#include /* cpu_relax() */ #warning FIXME:This file was change, but is untest! @@ -79,10 +76,8 @@ static void flash25_waitReady(Flash25 *fd) if (!(stat & RDY_BIT)) break; - #if CONFIG_KERNEL - else - proc_switch(); - #endif + + cpu_relax(); } } @@ -140,7 +135,7 @@ static bool flash25_pin_init(Flash25 *fd) */ static KFile * flash25_reopen(struct KFile *_fd) { - Flash25 *fd = FLASH25KFILE(_fd); + Flash25 *fd = FLASH25_CAST(_fd); fd->fd.seek_pos = 0; fd->fd.size = FLASH25_MEM_SIZE; @@ -176,7 +171,7 @@ static size_t flash25_read(struct KFile *_fd, void *buf, size_t size) { uint8_t *data = (uint8_t *)buf; - Flash25 *fd = FLASH25KFILE(_fd); + Flash25 *fd = FLASH25_CAST(_fd); ASSERT(fd->fd.seek_pos + (kfile_size_t)size <= fd->fd.size); size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos); @@ -229,7 +224,7 @@ static size_t flash25_write(struct KFile *_fd, const void *_buf, size_t size) flash25Size_t wr_len; const uint8_t *data = (const uint8_t *) _buf; - Flash25 *fd = FLASH25KFILE(_fd); + Flash25 *fd = FLASH25_CAST(_fd); ASSERT(fd->fd.seek_pos + (kfile_size_t)size <= fd->fd.size);