Allow finding files in the root directory
This allows you to find the cluster number of a file in the root directory by name. The main program is a simple demo where you can type in a filename and it will tell you the cluster number.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <stdint.h>
|
||||
#include <conio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "devices/board_io.h"
|
||||
#include "devices/uart.h"
|
||||
@@ -14,6 +15,7 @@ uint8_t buf[512];
|
||||
int main() {
|
||||
int i;
|
||||
uint16_t rca;
|
||||
char* filename;
|
||||
|
||||
clrscr();
|
||||
cprintf("Hello, world!\n");
|
||||
@@ -34,7 +36,17 @@ int main() {
|
||||
sd_select_card(rca);
|
||||
|
||||
fat_init();
|
||||
exec("/test.o65");
|
||||
|
||||
filename = (char*)malloc(FAT_MAX_FILE_NAME);
|
||||
|
||||
for(;;) {
|
||||
cprintf("Filename: ");
|
||||
cscanf("%s", filename);
|
||||
cprintf("\n");
|
||||
fat_parse_path_to_cluster(filename);
|
||||
}
|
||||
|
||||
//exec("/test.o65");
|
||||
|
||||
cprintf("Done!\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user