emunand: Use HOS archive style for rawnand parts

This commit is contained in:
hexkyz 2019-04-28 18:22:32 +01:00
parent a9afbd2458
commit 0177b612f4
6 changed files with 59 additions and 7 deletions

View file

@ -300,6 +300,21 @@ int fsdev_unmount_all(void) {
return 0;
}
int fsdev_set_attr(const char *file, int attr, int mask) {
return fsdev_convert_rc(NULL, f_chmod(file, (BYTE)attr, (BYTE)mask));
}
int fsdev_get_attr(const char *file) {
FILINFO info;
FRESULT rc = f_stat(file, &info);
if (rc == FR_OK) {
return info.fattrib;
}
return fsdev_convert_rc(NULL, rc);
}
/* Adapted from https://github.com/benemorius/openOBC-devboard/blob/bf0a4a33e22d24e7c299f921d185da27377310e0/lib/fatfs/FatFS.cpp#L173 */
static int fsdev_convert_rc(struct _reent *r, FRESULT rc) {
int errornumber;