From bc0c747f26c9030ff3ebb80f5d2db330df5eac56 Mon Sep 17 00:00:00 2001 From: asterix Date: Mon, 8 Nov 2010 10:23:48 +0000 Subject: [PATCH] Open by default the kblock device in bufferd mode. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4531 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/flash.h | 4 ++-- bertos/drv/sd.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bertos/drv/flash.h b/bertos/drv/flash.h index da1fa801..9ea56650 100644 --- a/bertos/drv/flash.h +++ b/bertos/drv/flash.h @@ -106,9 +106,9 @@ void flash_hw_initUnbuffered(Flash *fls, int flags); #include CPU_HEADER(flash) #define FLASH_WRITE_ONCE BV(0) ///< Allow only one write per block. -#define FLASH_BUFFERED BV(1) ///< Open flash memory using page caching, allowing the modification and partial write. +#define FLASH_UNBUFFERED BV(1) ///< Open flash memory disabling page caching, no modification and partial write are allowed. -#define flash_init_2(fls, flags) (flags & FLASH_BUFFERED) ? \ +#define flash_init_2(fls, flags) (flags & FLASH_UNBUFFERED) ? \ flash_hw_initUnbuffered(fls, flags) : flash_hw_init(fls, flags) #if !CONFIG_FLASH_DISABLE_OLD_API diff --git a/bertos/drv/sd.h b/bertos/drv/sd.h index 22a19d1e..df12bb6e 100644 --- a/bertos/drv/sd.h +++ b/bertos/drv/sd.h @@ -44,12 +44,15 @@ #ifndef DRV_SD_H #define DRV_SD_H +#include "cfg/cfg_sd.h" + #include #include #include -#include "cfg/cfg_sd.h" + +#define SD_UNBUFFERED BV(0) ///< Open SD memory disabling page caching, no modification and partial write are allowed. /** * SD Card context structure. @@ -99,7 +102,7 @@ bool sd_initBuf(Sd *sd, KFile *ch); * * \return true if initialization succeds, false otherwise. */ - #define sd_init(sd, ch, buffered) ((buffered) ? sd_initBuf((sd), (ch)) : sd_initUnbuf((sd), (ch))) + #define sd_init(sd, ch, buffered) ((buffered & SD_UNBUFFERED) ? sd_initUnbuf((sd), (ch)) : sd_initBuf((sd), (ch))) #endif -- 2.25.1