Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法找到 FreeRTOS.h,DSTATUS、DWORD 等变量名未定义,sd_diskio.cpp 中某些函数未定义等问题的解决方法。 #28

Open
MXuanZero opened this issue Aug 22, 2022 · 2 comments

Comments

@MXuanZero
Copy link

MXuanZero commented Aug 22, 2022

如图,我用 CLion 编译项目时发生了如下错误。感觉我的 PlatformIO 好像少了什么文件一样,但我重装了两三次都存在这个问题?请问有办法解决吗?
image

@MXuanZero MXuanZero changed the title 请教一下各位,VS Code 打开工程后找不到 FreeRTOS.h 该怎么解决? 请教一下各位,CLion 编译时error: 'DWORD' has not been declared .... Aug 22, 2022
@MXuanZero
Copy link
Author

MXuanZero commented Aug 22, 2022

花了一下午时间终于解决了,我们将以下代码复制到 diskio.h 的第 12 行。这个地方最初应该只有一行 typedef BYTE DSTATUS;

/* Status of Disk Functions */
/* This type MUST be 8 bit */
typedef unsigned char	BYTE;
typedef BYTE			DSTATUS;	//最初
/* These types MUST be 16 bit */
typedef short			SHORT;
typedef unsigned short	WORD;
typedef unsigned short	WCHAR;

/* These types MUST be 16 bit or 32 bit */
typedef int				INT;
typedef unsigned int	UINT;

/* These types MUST be 32 bit */
typedef long			LONG;
typedef uint32_t		DWORD;

**补充1:**倘若无法找到 FreeRTOS.h,我们只是要将工程中出现 FreeRTOS.h 的地方改成 freertos/FreeRTOS.h 就行了。

**补充2:**倘若出现类似于 error: 'ff_diskio_get_drive' was not declared in this scope 这种 FATFS 系统的函数找不到的错误。我们要将 #include "diskio_impl.h" 添加到 sd_diskio.cpp 中。

image-20220822182305399

==**请注意:**以上方法虽然可以成功编译,但我并没有烧到板子上去,所以也不知道能不能成!如果有人成功的话麻烦告知一下。==

@MXuanZero MXuanZero changed the title 请教一下各位,CLion 编译时error: 'DWORD' has not been declared .... 无法找到 FreeRTOS,DSTATUS、DWORD 等变量名未定义,sd_diskio.cpp 中某些函数未定义等问题的解决方法。 Aug 22, 2022
@MXuanZero MXuanZero changed the title 无法找到 FreeRTOS,DSTATUS、DWORD 等变量名未定义,sd_diskio.cpp 中某些函数未定义等问题的解决方法。 无法找到 FreeRTOS.h,DSTATUS、DWORD 等变量名未定义,sd_diskio.cpp 中某些函数未定义等问题的解决方法。 Aug 22, 2022
@LiangTY
Copy link

LiangTY commented Aug 27, 2022

DSTATUS、DWORD等问题,可以把#include "ff.h"放在#include "diskio.h"前面,让ff.h先编译即可。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants