X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fflash_avr.c;h=c9f27f5a960b56210d85addc09357efdc8fbb079;hb=50cc352d570076bb1c5e6a79764da95681ef0887;hp=4ae4f2313b56f184b5d0f108bfe0d7abc60c2802;hpb=d4d9e245c5c9c8eb42787e4f59a7d74271e15f77;p=bertos.git diff --git a/drv/flash_avr.c b/drv/flash_avr.c old mode 100755 new mode 100644 index 4ae4f231..c9f27f5a --- a/drv/flash_avr.c +++ b/drv/flash_avr.c @@ -1,8 +1,33 @@ /** * \file * * * \brief Self programming routines. @@ -185,19 +210,19 @@ static bool flash_avr_close(UNUSED_ARG(struct _KFile *,fd)) * Move \a fd file seek position of \a offset bytes * from current position. */ -static int32_t flash_avr_seek(struct _KFile *fd, int32_t offset, int whence) +static int32_t flash_avr_seek(struct _KFile *fd, int32_t offset, KSeekMode whence) { uint32_t seek_pos; switch(whence) { - case SEEK_SET: + case KSM_SEEK_SET: seek_pos = 0; break; - case SEEK_END: + case KSM_SEEK_END: seek_pos = fd->size - 1; break; - case SEEK_CUR: + case KSM_SEEK_CUR: seek_pos = fd->seek_pos; break; default: @@ -205,7 +230,7 @@ static int32_t flash_avr_seek(struct _KFile *fd, int32_t offset, int whence) return -1; break; } - + /* Bound check */ if (seek_pos + offset > fd->size) {