How to include FatFS properly?
Hello, I want to write data to a SD card. When I want to include fatfs, in header files i get errors.
ff_gen_drv.h line 57 (typedef struct { uint8_t is_initialized[_VOLUMES];:( '_VOLUMES' undeclared here (not in a function)
sd_diskio.h line 35 (extern const Diskio_drvTypeDef SD_Driver;:( unknown type name 'Diskio_drvTypeDef'
sd_diskio.c line 70 (const Diskio_drvTypeDef SD_Driver =:( conflicting types for 'SD_Driver'; have 'Diskio_drvTypeDef'
fatfs.h line 36 (extern FATFS SDFatFS;:( unknown type name 'FATFS'
fatfs.h line 37 (extern FIL SDFile;:( unknown type name 'FIL'
I enabled SDIO and FatFS and generated the code.
In the code I deleted #include "fatfs.h" line in main.c. After that, I created 2 new files called "sd.c" and "sd.h" in /Core/User folder which i've created.
SD.H file:
#ifndef USER_SD_H_
#define USER_SD_H_
#include "fatfs.h"
#endif /* USER_SD_H_ */
SD.C file:
#include "sd.h"
main.h file:
/* USER CODE BEGIN Includes */
#include "sd.h"
/* USER CODE END Includes */
I want to be able to include "fatfs.h" file in other files. Right now i am only able to include it in the .c files. When i want to include it in .h files, i get errors. How can i fix this?
