?? _fs_flushbuf.c
字號(hào):
/*----------------------------------------------------------------------------
* R T L - F l a s h F i l e S y s t e m
*----------------------------------------------------------------------------
* Name: _FS_FLUSHBUF.C
* Purpose: Low level File Flush Buffer Function
* Rev.: V3.22
*----------------------------------------------------------------------------
* This code is part of the RealView Run-Time Library.
* Copyright (c) 2004-2008 KEIL - An ARM Company. All rights reserved.
*---------------------------------------------------------------------------*/
#include "File_Config.h"
/*--------------------------- __flushbuf ------------------------------------*/
int __flushbuf (int handle) {
/* Low level file flush function. */
FALLOC alloc;
IOB *fcb;
fcb = &_iob[handle];
if (!(fcb->flags & _IOWRT)) {
/* File not opened for write */
fcb->flags |= _IOERR;
return (-1);
}
if (fcb->drive == DRV_MCARD) {
return (0);
}
if (fcb->flags & _IOWALLOC) {
/* buffer present and buffered I/O requested */
alloc.end = fcb->_fbot;
alloc.fileID = fcb->fileID;
alloc.index = fcb->_fidx++;
fs_WriteBlock (((DEVCONF *)fcb->DevCfg)[fcb->_fblock].bStart + fcb->_ftop,
&alloc, sizeof (FALLOC), fcb);
/* Always write on 4-byte boundaries. */
fcb->_ftop -= sizeof (FALLOC);
fcb->_fbot = (fcb->_fbot + 3) & ~3;
fcb->flags &= ~_IOWALLOC;
}
return (0);
}
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -