下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

最新资讯
简化任何设备的身份验证云连接。
利用 CoAP 设计节能型云连接 IoT 解决方案。
11.0.0 版 FreeRTOS 内核简介:
FreeRTOS 路线图和代码贡献流程。
使用 FreeRTOS 实现 OPC-UA over TSN。

ff_rewind()

[FreeRTOS-Plus-FAT 标准 API 引用]

ff_stdio.h
void ff_rewind( FF_FILE *pxStream );
		

将当前读/写位置移回文件的开头。

调用......
ff_rewind( pxStream );

.....等于调用
( void ) ff_fseek( pxStream, 0, FF_SEEK_SET );.

参数:

pxStream   将当前读/写位置设置回 文件开头的文件。

用法示例:


void vSampleFunction( void )
{
char pcBuffer1[ 4 ], pcBuffer2[ 4 ];
FF_FILE *pxFile;

/* Open the file "afile.bin". */
pxFile = ff_fopen( "afile.bin", "r" );

if( pxFile != NULL )
{
/* Read four bytes into pcBuffer1. */
ff_fread( pcBuffer1, 4, 1, pxFile );

/* Set the current read pointer back to the start of the file. */
ff_rewind( pxFile );

/* Read the same four bytes into pcBuffer2. */
ff_fread( pcBuffer2, 4, 1, pxFile );

/* Finished with the file. */
ff_fclose( pxFile );
}
}

Example use of the ff_rewind() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.