|
|
|
@ -24,21 +24,24 @@
@@ -24,21 +24,24 @@
|
|
|
|
|
|
|
|
|
|
#include "AP_Filesystem_Available.h" |
|
|
|
|
|
|
|
|
|
#ifndef MAX_NAME_LEN |
|
|
|
|
#define MAX_NAME_LEN 255 |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS |
|
|
|
|
#if HAVE_FILESYSTEM_SUPPORT |
|
|
|
|
#include "AP_Filesystem_FATFS.h" |
|
|
|
|
#endif |
|
|
|
|
#define DT_REG 0 |
|
|
|
|
#define DT_DIR 1 |
|
|
|
|
#if defined(FF_MAX_LFN) && FF_USE_LFN != 0 |
|
|
|
|
#define MAX_NAME_LEN FF_MAX_LFN |
|
|
|
|
#else |
|
|
|
|
#define MAX_NAME_LEN 13 |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
struct dirent { |
|
|
|
|
char d_name[MAX_NAME_LEN]; /* filename */ |
|
|
|
|
uint8_t d_type; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#endif // HAL_BOARD_CHIBIOS
|
|
|
|
|
|
|
|
|
|
#include <fcntl.h> |
|
|
|
|
#include <errno.h> |
|
|
|
|
#include <unistd.h> |
|
|
|
@ -46,10 +49,12 @@ struct dirent {
@@ -46,10 +49,12 @@ struct dirent {
|
|
|
|
|
#ifndef AP_FILESYSTEM_FORMAT_ENABLED |
|
|
|
|
// only enable for SDMMC filesystems for now as other types can't query
|
|
|
|
|
// block size
|
|
|
|
|
#define AP_FILESYSTEM_FORMAT_ENABLED (STM32_SDC_USE_SDMMC1==TRUE || STM32_SDC_USE_SDMMC2==TRUE) |
|
|
|
|
#ifndef HAL_USE_SDMMC |
|
|
|
|
#define HAL_USE_SDMMC 0 |
|
|
|
|
#endif |
|
|
|
|
#define AP_FILESYSTEM_FORMAT_ENABLED HAL_USE_SDMMC |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#endif // HAL_BOARD_CHIBIOS
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_SITL |
|
|
|
|
#include "AP_Filesystem_posix.h" |
|
|
|
|
#endif |
|
|
|
|