Added HIDE_HIDDEN build parameter

This commit is contained in:
d0k3 2017-12-18 16:53:25 +01:00
parent 61c93e1222
commit 32b9675c49
2 changed files with 8 additions and 0 deletions

View File

@ -46,6 +46,10 @@ ifeq ($(TIMER_UNLOCK),1)
CFLAGS += -DTIMER_UNLOCK CFLAGS += -DTIMER_UNLOCK
endif endif
ifeq ($(HIDE_HIDDEN),1)
CFLAGS += -DHIDE_HIDDEN
endif
ifdef FIXED_BRIGHTNESS ifdef FIXED_BRIGHTNESS
CFLAGS += -DFIXED_BRIGHTNESS=$(FIXED_BRIGHTNESS) CFLAGS += -DFIXED_BRIGHTNESS=$(FIXED_BRIGHTNESS)
endif endif

View File

@ -122,6 +122,10 @@ bool GetDirContentsWorker(DirStruct* contents, char* fpath, int fnsize, const ch
while (fvx_readdir(&pdir, &fno) == FR_OK) { while (fvx_readdir(&pdir, &fno) == FR_OK) {
if ((strncmp(fno.fname, ".", 2) == 0) || (strncmp(fno.fname, "..", 3) == 0)) if ((strncmp(fno.fname, ".", 2) == 0) || (strncmp(fno.fname, "..", 3) == 0))
continue; // filter out virtual entries continue; // filter out virtual entries
#ifdef HIDE_HIDDEN
if (fno.fattrib & AM_HID)
continue; // filter out hidden entries
#endif
strncpy(fname, fno.fname, (fnsize - 1) - (fname - fpath)); strncpy(fname, fno.fname, (fnsize - 1) - (fname - fpath));
if (fno.fname[0] == 0) { if (fno.fname[0] == 0) {
ret = true; ret = true;