From 6aafc026c506cab1b2ebffa9e0b9a5b8649f4f67 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 23 Feb 2023 02:40:07 +0000 Subject: [PATCH] Update file locations Add directory listing --- Makefile | 2 +- src/libs/menu_utils/{ => include}/mem_pool.h | 0 .../menu_utils/{ => include}/memory_alloc.h | 0 src/libs/menu_utils/{ => include}/menu.h | 0 .../menu_utils/{ => sample_assets}/menu.png | Bin src/libs/menu_utils/{ => src}/mem_pool.c | 0 src/libs/menu_utils/{ => src}/menu.c | 0 src/menu/menu.c | 17 ++++++++++++++++- 8 files changed, 17 insertions(+), 2 deletions(-) rename src/libs/menu_utils/{ => include}/mem_pool.h (100%) rename src/libs/menu_utils/{ => include}/memory_alloc.h (100%) rename src/libs/menu_utils/{ => include}/menu.h (100%) rename src/libs/menu_utils/{ => sample_assets}/menu.png (100%) rename src/libs/menu_utils/{ => src}/mem_pool.c (100%) rename src/libs/menu_utils/{ => src}/menu.c (100%) diff --git a/Makefile b/Makefile index d57b52ff..7c26572b 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ SRCS = \ menu/menu.c \ utils/fs.c \ libs/toml/toml.c \ - libs/menu_utils/menu.c \ + libs/menu_utils/src/menu.c \ main.c OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS)))) diff --git a/src/libs/menu_utils/mem_pool.h b/src/libs/menu_utils/include/mem_pool.h similarity index 100% rename from src/libs/menu_utils/mem_pool.h rename to src/libs/menu_utils/include/mem_pool.h diff --git a/src/libs/menu_utils/memory_alloc.h b/src/libs/menu_utils/include/memory_alloc.h similarity index 100% rename from src/libs/menu_utils/memory_alloc.h rename to src/libs/menu_utils/include/memory_alloc.h diff --git a/src/libs/menu_utils/menu.h b/src/libs/menu_utils/include/menu.h similarity index 100% rename from src/libs/menu_utils/menu.h rename to src/libs/menu_utils/include/menu.h diff --git a/src/libs/menu_utils/menu.png b/src/libs/menu_utils/sample_assets/menu.png similarity index 100% rename from src/libs/menu_utils/menu.png rename to src/libs/menu_utils/sample_assets/menu.png diff --git a/src/libs/menu_utils/mem_pool.c b/src/libs/menu_utils/src/mem_pool.c similarity index 100% rename from src/libs/menu_utils/mem_pool.c rename to src/libs/menu_utils/src/mem_pool.c diff --git a/src/libs/menu_utils/menu.c b/src/libs/menu_utils/src/menu.c similarity index 100% rename from src/libs/menu_utils/menu.c rename to src/libs/menu_utils/src/menu.c diff --git a/src/menu/menu.c b/src/menu/menu.c index f2bd8c7f..adbc065d 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -121,7 +121,22 @@ void menu_run (menu_t *menu) { } else { printf("N64 Flashcart Menu\n\n"); - wait_ms(2000); + printf("File list:\n"); + DIR *dp; + struct dirent *ep; + dp = opendir ("sd://"); + if (dp != NULL) + { + while ((ep = readdir (dp)) != NULL) + puts (ep->d_name); + + (void) closedir (dp); + return 0; + } + else + { + printf("Couldn't open the directory"); + } // TODO: wait for a key input } // TODO: write menu state to SD card