Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
人间散章
rt-thread
提交
ecd84844
R
rt-thread
项目概览
人间散章
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ecd84844
编写于
10月 25, 2021
作者:
M
mazhiyuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update fatfs to the latest version
上级
574e11f6
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
829 addition
and
715 deletion
+829
-715
components/dfs/filesystems/elmfat/.ignore_format.yml
components/dfs/filesystems/elmfat/.ignore_format.yml
+10
-0
components/dfs/filesystems/elmfat/00history.txt
components/dfs/filesystems/elmfat/00history.txt
+19
-0
components/dfs/filesystems/elmfat/00readme.txt
components/dfs/filesystems/elmfat/00readme.txt
+1
-1
components/dfs/filesystems/elmfat/diskio.h
components/dfs/filesystems/elmfat/diskio.h
+29
-29
components/dfs/filesystems/elmfat/ff.c
components/dfs/filesystems/elmfat/ff.c
+695
-590
components/dfs/filesystems/elmfat/ff.h
components/dfs/filesystems/elmfat/ff.h
+36
-41
components/dfs/filesystems/elmfat/ffconf.h
components/dfs/filesystems/elmfat/ffconf.h
+39
-54
未找到文件。
components/dfs/filesystems/elmfat/.ignore_format.yml
0 → 100644
浏览文件 @
ecd84844
# files format check exclude path, please follow the instructions below to modify;
# If you need to exclude an entire folder, add the folder path in dir_path;
# If you need to exclude a file, add the path to the file in file_path.
dir_path
:
-
diskio.h
-
ff.c
-
ff.h
-
ffconf.h
-
ffunicode.c
components/dfs/filesystems/elmfat/00history.txt
浏览文件 @
ecd84844
...
...
@@ -338,3 +338,22 @@ R0.14 (October 14, 2019)
Fixed f_readdir() function returns file names with wrong case conversion. (appeared at R0.12)
Fixed f_mkfs() function can fail to create exFAT volume in the second partition. (appeared at R0.12)
R0.14a (December 5, 2020)
Limited number of recursive calls in f_findnext().
Fixed old floppy disks formatted with MS-DOS 2.x and 3.x cannot be mounted.
Fixed some compiler warnings.
R0.14b (April 17, 2021)
Made FatFs uses standard library <string.h> for copy, compare and search instead of built-in string functions.
Added support for long long integer and floating point to f_printf(). (FF_STRF_LLI and FF_STRF_FP)
Made path name parser ignore the terminating separator to allow "dir/".
Improved the compatibility in Unix style path name feature.
Fixed the file gets dead-locked when f_open() failed with some conditions. (appeared at R0.12a)
Fixed f_mkfs() can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)
Fixed code page 855 cannot be set by f_setcp().
Fixed some compiler warnings.
components/dfs/filesystems/elmfat/00readme.txt
浏览文件 @
ecd84844
FatFs Module Source Files R0.14
FatFs Module Source Files R0.14
b
FILES
...
...
components/dfs/filesystems/elmfat/diskio.h
浏览文件 @
ecd84844
...
...
@@ -10,15 +10,15 @@ extern "C" {
#endif
/* Status of Disk Functions */
typedef
BYTE
DSTATUS
;
typedef
BYTE
DSTATUS
;
/* Results of Disk Functions */
typedef
enum
{
RES_OK
=
0
,
/* 0: Successful */
RES_ERROR
,
/* 1: R/W Error */
RES_WRPRT
,
/* 2: Write Protected */
RES_NOTRDY
,
/* 3: Not Ready */
RES_PARERR
/* 4: Invalid Parameter */
RES_OK
=
0
,
/* 0: Successful */
RES_ERROR
,
/* 1: R/W Error */
RES_WRPRT
,
/* 2: Write Protected */
RES_NOTRDY
,
/* 3: Not Ready */
RES_PARERR
/* 4: Invalid Parameter */
}
DRESULT
;
...
...
@@ -35,40 +35,40 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
/* Disk Status Bits (DSTATUS) */
#define STA_NOINIT
0x01
/* Drive not initialized */
#define STA_NODISK
0x02
/* No medium in the drive */
#define STA_PROTECT
0x04
/* Write protected */
#define STA_NOINIT
0x01
/* Drive not initialized */
#define STA_NODISK
0x02
/* No medium in the drive */
#define STA_PROTECT
0x04
/* Write protected */
/* Command code for disk_ioctrl fucntion */
/* Generic command (Used by FatFs) */
#define CTRL_SYNC
0
/* Complete pending write process (needed at FF_FS_READONLY == 0) */
#define GET_SECTOR_COUNT
1
/* Get media size (needed at FF_USE_MKFS == 1) */
#define GET_SECTOR_SIZE
2
/* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
#define GET_BLOCK_SIZE
3
/* Get erase block size (needed at FF_USE_MKFS == 1) */
#define CTRL_TRIM
4
/* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
#define CTRL_SYNC
0
/* Complete pending write process (needed at FF_FS_READONLY == 0) */
#define GET_SECTOR_COUNT
1
/* Get media size (needed at FF_USE_MKFS == 1) */
#define GET_SECTOR_SIZE
2
/* Get sector size (needed at FF_MAX_SS != FF_MIN_SS) */
#define GET_BLOCK_SIZE
3
/* Get erase block size (needed at FF_USE_MKFS == 1) */
#define CTRL_TRIM
4
/* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
/* Generic command (Not used by FatFs) */
#define CTRL_POWER
5
/* Get/Set power status */
#define CTRL_LOCK
6
/* Lock/Unlock media removal */
#define CTRL_EJECT
7
/* Eject media */
#define CTRL_FORMAT
8
/* Create physical format on the media */
#define CTRL_POWER
5
/* Get/Set power status */
#define CTRL_LOCK
6
/* Lock/Unlock media removal */
#define CTRL_EJECT
7
/* Eject media */
#define CTRL_FORMAT
8
/* Create physical format on the media */
/* MMC/SDC specific ioctl command */
#define MMC_GET_TYPE
10
/* Get card type */
#define MMC_GET_CSD
11
/* Get CSD */
#define MMC_GET_CID
12
/* Get CID */
#define MMC_GET_OCR
13
/* Get OCR */
#define MMC_GET_SDSTAT
14
/* Get SD status */
#define ISDIO_READ
55
/* Read data form SD iSDIO register */
#define ISDIO_WRITE
56
/* Write data to SD iSDIO register */
#define ISDIO_MRITE
57
/* Masked write data to SD iSDIO register */
#define MMC_GET_TYPE
10
/* Get card type */
#define MMC_GET_CSD
11
/* Get CSD */
#define MMC_GET_CID
12
/* Get CID */
#define MMC_GET_OCR
13
/* Get OCR */
#define MMC_GET_SDSTAT
14
/* Get SD status */
#define ISDIO_READ
55
/* Read data form SD iSDIO register */
#define ISDIO_WRITE
56
/* Write data to SD iSDIO register */
#define ISDIO_MRITE
57
/* Masked write data to SD iSDIO register */
/* ATA/CF specific ioctl command */
#define ATA_GET_REV
20
/* Get F/W revision */
#define ATA_GET_MODEL
21
/* Get model name */
#define ATA_GET_SN
22
/* Get serial number */
#define ATA_GET_REV
20
/* Get F/W revision */
#define ATA_GET_MODEL
21
/* Get model name */
#define ATA_GET_SN
22
/* Get serial number */
#ifdef __cplusplus
}
...
...
components/dfs/filesystems/elmfat/ff.c
浏览文件 @
ecd84844
此差异已折叠。
点击以展开。
components/dfs/filesystems/elmfat/ff.h
浏览文件 @
ecd84844
/*----------------------------------------------------------------------------/
/ FatFs - Generic FAT Filesystem module R0.14
/
/ FatFs - Generic FAT Filesystem module R0.14
b
/
/-----------------------------------------------------------------------------/
/
/ Copyright (C) 20
19
, ChaN, all right reserved.
/ Copyright (C) 20
21
, ChaN, all right reserved.
/
/ FatFs module is an open source software. Redistribution and use of FatFs in
/ source and binary forms, with or without modification, are permitted provided
...
...
@@ -20,13 +20,12 @@
#ifndef FF_DEFINED
#define FF_DEFINED 866
06
/* Revision ID */
#define FF_DEFINED 866
31
/* Revision ID */
#ifdef __cplusplus
extern
"C"
{
#endif
#include <rtthread.h>
#include "ffconf.h"
/* FatFs configuration options */
#if FF_DEFINED != FFCONF_DEF
...
...
@@ -36,10 +35,14 @@ extern "C" {
/* Integer types used for FatFs API */
#if defined(_WIN32)
/* Main development platform
*/
#if defined(_WIN32)
/* Windows VC++ (for development only)
*/
#define FF_INTDEF 2
#include <windows.h>
typedef
unsigned
__int64
QWORD
;
#include <float.h>
#define isnan(v) _isnan(v)
#define isinf(v) (!_finite(v))
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus)
/* C99 or later */
#define FF_INTDEF 2
#include <stdint.h>
...
...
@@ -49,6 +52,7 @@ typedef uint16_t WORD; /* 16-bit unsigned integer */
typedef
uint32_t
DWORD
;
/* 32-bit unsigned integer */
typedef
uint64_t
QWORD
;
/* 64-bit unsigned integer */
typedef
WORD
WCHAR
;
/* UTF-16 character type */
#else
/* Earlier than C99 */
#define FF_INTDEF 1
typedef
unsigned
int
UINT
;
/* int must be 16-bit or 32-bit */
...
...
@@ -59,28 +63,29 @@ typedef WORD WCHAR; /* UTF-16 character type */
#endif
/*
Definitions of volume management
*/
/*
Type of file size and LBA variables
*/
#if FF_MULTI_PARTITION
/* Multiple partition configuration */
typedef
struct
{
BYTE
pd
;
/* Physical drive number */
BYTE
pt
;
/* Partition: 0:Auto detect, 1-4:Forced partition) */
}
PARTITION
;
extern
PARTITION
VolToPart
[];
/* Volume - Partition mapping table */
#if FF_FS_EXFAT
#if FF_INTDEF != 2
#error exFAT feature wants C99 or later
#endif
#if FF_STR_VOLUME_ID
#ifndef FF_VOLUME_STRS
extern
const
char
*
VolumeStr
[
FF_VOLUMES
];
/* User defied volume ID */
typedef
QWORD
FSIZE_t
;
#if FF_LBA64
typedef
QWORD
LBA_t
;
#else
typedef
DWORD
LBA_t
;
#endif
#else
#if FF_LBA64
#error exFAT needs to be enabled when enable 64-bit LBA
#endif
typedef
DWORD
FSIZE_t
;
typedef
DWORD
LBA_t
;
#endif
/* Type of path name strings on FatFs API */
#ifndef _INC_TCHAR
#define _INC_TCHAR
/* Type of path name strings on FatFs API (TCHAR) */
#if FF_USE_LFN && FF_LFN_UNICODE == 1
/* Unicode in UTF-16 encoding */
typedef
WCHAR
TCHAR
;
...
...
@@ -102,28 +107,22 @@ typedef char TCHAR;
#define _TEXT(x) x
#endif
#endif
/* Definitions of volume management */
/* Type of file size and LBA variables */
#if FF_FS_EXFAT
#if FF_INTDEF != 2
#error exFAT feature wants C99 or later
#endif
typedef
QWORD
FSIZE_t
;
#if FF_LBA64
typedef
QWORD
LBA_t
;
#else
typedef
DWORD
LBA_t
;
#if FF_MULTI_PARTITION
/* Multiple partition configuration */
typedef
struct
{
BYTE
pd
;
/* Physical drive number */
BYTE
pt
;
/* Partition: 0:Auto detect, 1-4:Forced partition) */
}
PARTITION
;
extern
PARTITION
VolToPart
[];
/* Volume - Partition mapping table */
#endif
#else
#if FF_LBA64
#error exFAT needs to be enabled when enable 64-bit LBA
#if FF_STR_VOLUME_ID
#ifndef FF_VOLUME_STRS
extern
const
char
*
VolumeStr
[
FF_VOLUMES
];
/* User defied volume ID */
#endif
typedef
DWORD
FSIZE_t
;
typedef
DWORD
LBA_t
;
#endif
...
...
@@ -347,10 +346,6 @@ TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the fil
#define f_rmdir(path) f_unlink(path)
#define f_unmount(path) f_mount(0, path, 0)
#ifndef EOF
#define EOF (-1)
#endif
...
...
components/dfs/filesystems/elmfat/ffconf.h
浏览文件 @
ecd84844
...
...
@@ -2,7 +2,7 @@
/ FatFs Functional Configurations
/---------------------------------------------------------------------------*/
#define FFCONF_DEF 866
06
/* Revision ID */
#define FFCONF_DEF 866
31
/* Revision ID */
/*---------------------------------------------------------------------------/
/ Function Configurations
...
...
@@ -25,14 +25,6 @@
/ 3: f_lseek() function is removed in addition to 2. */
#define FF_USE_STRFUNC 0
/* This option switches string functions, f_gets(), f_putc(), f_puts() and f_printf().
/
/ 0: Disable string functions.
/ 1: Enable without LF-CRLF conversion.
/ 2: Enable with LF-CRLF conversion. */
#define FF_USE_FIND 0
/* This option switches filtered directory read functions, f_findfirst() and
/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
...
...
@@ -64,15 +56,35 @@
/* This option switches f_forward() function. (0:Disable or 1:Enable) */
#define FF_USE_STRFUNC 0
#define FF_PRINT_LLI 0
#define FF_PRINT_FLOAT 0
#define FF_STRF_ENCODE 3
/* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and
/ f_printf().
/
/ 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect.
/ 1: Enable without LF-CRLF conversion.
/ 2: Enable with LF-CRLF conversion.
/
/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2
makes f_printf() support floating point argument. These features want C99 or later.
/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character
/ encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE
/ to be read/written via those functions.
/
/ 0: ANSI/OEM in current CP
/ 1: Unicode in UTF-16LE
/ 2: Unicode in UTF-16BE
/ 3: Unicode in UTF-8
*/
/*---------------------------------------------------------------------------/
/ Locale and Namespace Configurations
/---------------------------------------------------------------------------*/
#ifdef RT_DFS_ELM_CODE_PAGE
# define FF_CODE_PAGE RT_DFS_ELM_CODE_PAGE
#else
# define FF_CODE_PAGE 936
#endif
#define FF_CODE_PAGE 932
/* This option specifies the OEM code page to be used on the target system.
/ Incorrect code page setting can cause a file open failure.
/
...
...
@@ -101,13 +113,8 @@
*/
#if RT_DFS_ELM_USE_LFN
#define FF_USE_LFN RT_DFS_ELM_USE_LFN
#define FF_MAX_LFN RT_DFS_ELM_MAX_LFN
#else
#define FF_USE_LFN 0
/* 0 to 3 */
#define FF_MAX_LFN 255
/* Maximum LFN length to handle (12 to 255) */
#endif
#define FF_USE_LFN 0
#define FF_MAX_LFN 255
/* The FF_USE_LFN switches the support for LFN (long file name).
/
/ 0: Disable LFN. FF_MAX_LFN has no effect.
...
...
@@ -126,7 +133,7 @@
/ ff_memfree() exemplified in ffsystem.c, need to be added to the project. */
#
ifdef RT_DFS_ELM_LFN_UNICODE
#
define FF_LFN_UNICODE 0
/* This option switches the character encoding on the API when LFN is enabled.
/
/ 0: ANSI/OEM in current CP (TCHAR = char)
...
...
@@ -136,10 +143,7 @@
/
/ Also behavior of string I/O functions will be affected by this option.
/ When LFN is not enabled, this option has no effect. */
#define FF_LFN_UNICODE RT_DFS_ELM_LFN_UNICODE
/* 0:ANSI/OEM or 1:Unicode */
#else
#define FF_LFN_UNICODE 0
/* 0:ANSI/OEM or 1:Unicode */
#endif
#define FF_LFN_BUF 255
#define FF_SFN_BUF 12
...
...
@@ -149,19 +153,6 @@
/ on character encoding. When LFN is not enabled, these options have no effect. */
#define FF_STRF_ENCODE 3
/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(),
/ f_putc(), f_puts and f_printf() convert the character encoding in it.
/ This option selects assumption of character encoding ON THE FILE to be
/ read/written via those functions.
/
/ 0: ANSI/OEM in current CP
/ 1: Unicode in UTF-16LE
/ 2: Unicode in UTF-16BE
/ 3: Unicode in UTF-8
*/
#define FF_FS_RPATH 0
/* This option configures support for relative path.
/
...
...
@@ -175,11 +166,7 @@
/ Drive/Volume Configurations
/---------------------------------------------------------------------------*/
#ifdef RT_DFS_ELM_DRIVES
#define FF_VOLUMES RT_DFS_ELM_DRIVES
#else
#define FF_VOLUMES 1
#endif
#define FF_VOLUMES 1
/* Number of volumes (logical drives) to be used. (1-10) */
...
...
@@ -206,7 +193,7 @@
/ funciton will be available. */
#define
FF_MIN_SS 512
#define
FF_MIN_SS 512
#ifdef RT_DFS_ELM_MAX_SECTOR_SIZE
#define FF_MAX_SS RT_DFS_ELM_MAX_SECTOR_SIZE
#else
...
...
@@ -214,7 +201,7 @@
#endif
/* This set of options configures the range of sector size to be supported. (512,
/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
/ harddisk
. B
ut a larger value may be required for on-board flash memory and some
/ harddisk
, b
ut a larger value may be required for on-board flash memory and some
/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured
/ for variable sector size mode and disk_ioctl() function needs to implement
/ GET_SECTOR_SIZE command. */
...
...
@@ -225,8 +212,8 @@
/ To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */
#define FF_MIN_GPT 0x10000000
0
/* Minimum number of sectors to switch GPT
format to create partition
in f_mkfs and
#define FF_MIN_GPT 0x10000000
/* Minimum number of sectors to switch GPT
as partitioning format
in f_mkfs and
/ f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */
...
...
@@ -247,11 +234,8 @@
/ Instead of private sector buffer eliminated from the file object, common sector
/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
#ifdef RT_DFS_ELM_USE_EXFAT
#define FF_FS_EXFAT 1
#else
#define FF_FS_EXFAT 0
#endif
#define FF_FS_EXFAT 0
/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
...
...
@@ -260,7 +244,7 @@
#define FF_FS_NORTC 0
#define FF_NORTC_MON 1
#define FF_NORTC_MDAY 1
#define FF_NORTC_YEAR 20
19
#define FF_NORTC_YEAR 20
20
/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
/ the timestamp function. Every object modified by FatFs will have a fixed timestamp
...
...
@@ -294,6 +278,7 @@
/ can be opened simultaneously under file lock control. Note that the file
/ lock control is independent of re-entrancy. */
/* #include <somertos.h> // O/S definitions */
#include <rtdef.h>
#ifdef RT_DFS_ELM_REENTRANT
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录