* the GNU General Public License.
*
* Copyright 2007 Develer S.r.l. (http://www.develer.com/)
- *
* -->
*
* \brief Function library for dataflash AT45DB family (implementation).
*
- *
* \version $Id: dataflash.c 21658 2008-06-05 16:42:54Z asterix $
* \author Daniele Basile <asterix@develer.com>
* \author Francesco Sacchi <batt@develer.com>
#include <kern/kfile.h>
-#if CONFIG_KERNEL
-#include <kern/proc.h>
-#endif
+#include <cpu/power.h> /* cpu_relax() */
#include <string.h>
* is high.
*/
while (!(dataflash_stat(fd) & BUSY_BIT))
- {
- #if CONFIG_KERNEL
- proc_switch();
- #endif
- }
+ cpu_relax();
stat = dataflash_stat(fd);
uint8_t *data = (uint8_t *)buf;
- ASSERT(fd->fd.seek_pos + size <= (kfile_size_t)fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ ASSERT(fd->fd.seek_pos + size <= (kfile_off_t)fd->fd.size);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
LOG_INFO("Reading at pos[%lu]\n", fd->fd.seek_pos);
const uint8_t *data = (const uint8_t *) _buf;
ASSERT(fd->fd.seek_pos + size <= (kfile_off_t)fd->fd.size);
- size = MIN((kfile_size_t)size, fd->fd.size - fd->fd.seek_pos);
+ size = MIN((kfile_off_t)size, fd->fd.size - fd->fd.seek_pos);
LOG_INFO("Writing at pos[%lu]\n", fd->fd.seek_pos);