Add errors

and prepare for file menu more
and fix that you can't go left right when going up down
This commit is contained in:
SuchMemeManySkill
2020-12-25 00:20:30 +01:00
parent b97bab3661
commit 1a931b0256
16 changed files with 167 additions and 30 deletions

View File

@@ -14,7 +14,8 @@ Vector_t /* of type FSEntry_t */ ReadFolder(char *path){
}
while (!f_readdir(&dir, &fno) && fno.fname[0]) {
FSEntry_t newEntry = {.isDir = (fno.fattrib & AM_DIR) ? 1 : 0, .name = CpyStr(fno.fname)};
FSEntry_t newEntry = {.optionUnion = fno.fattrib, .name = CpyStr(fno.fname)};
if (!newEntry.isDir){
u64 total = fno.fsize;
u8 type = 0;
@@ -33,5 +34,7 @@ Vector_t /* of type FSEntry_t */ ReadFolder(char *path){
vecAddElem(&out, newEntry);
}
f_closedir(&dir);
return out;
}

View File

@@ -1,23 +1,6 @@
#pragma once
#include <utils/types.h>
#include "../../utils/vector.h"
typedef struct {
char *name;
union {
struct {
u8 isDir:1;
};
u8 optionUnion;
};
union {
struct {
u16 size:12;
u16 showSize:1;
u16 sizeDef:3;
};
u16 sizeUnion;
};
} FSEntry_t;
#include "../fstypes.h"
Vector_t /* of type FSEntry_t */ ReadFolder(char *path);