mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Filesystem: Add dir type to fatfs
This commit is contained in:
parent
d00f4316e9
commit
14bf946fe2
@ -716,6 +716,11 @@ struct dirent *AP_Filesystem::readdir(DIR *dirp)
|
||||
len = strlen(fno.fname);
|
||||
strncpy(d->de.d_name,fno.fname,len);
|
||||
d->de.d_name[len] = 0;
|
||||
if (fno.fattrib & AM_DIR) {
|
||||
d->de.d_type = DT_DIR;
|
||||
} else {
|
||||
d->de.d_type = DT_REG;
|
||||
}
|
||||
return &d->de;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,10 @@
|
||||
#define MAX_NAME_LEN 13
|
||||
#endif
|
||||
|
||||
#define DT_REG 0
|
||||
#define DT_DIR 1
|
||||
|
||||
struct dirent {
|
||||
char d_name[MAX_NAME_LEN]; /* filename */
|
||||
uint8_t d_type;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user