I'm working on a project which involves loading files from either Storage Memory (\\fls0\) or an SD Card (\\crd0\).
I've been trying to list the root directory of the flash, but it doesn't quite work right, to say the least. Here's what I'm trying to do and the calculator output:
Bdisp_AllClr_DDVRAM(); locate(1, 1); Print("SD Card"); Bfile_FindFirst(flashPath, &fileSearchHandle, fileSearchPath, fileSearchInfo); for (i = 0; i < 8; i++) { locate(2, 2 + i); Print(fileSearchPath); if (!Bfile_FindNext(fileSearchHandle, fileSearchPath, fileSearchInfo)) break; } Bfile_FindClose(fileSearchHandle);
So far, my reasoning leads me to think that FONTCHARACTER (which according to VSCode, is an unsigned short) is not interchangable to a simple unsigned char pointer the Print method uses. I've tried to see if that's the case by trying to implement a quick and dirty FONTCHARACTER to char* converter, which to say the least... it doesn't work.
void fc2str(FONTCHARACTER* fc, unsigned char* str) { FONTCHARACTER* inChar = fc; unsigned char* outChar = str; do { *outChar = (unsigned char)*inChar; inChar++; outChar++; } while (*outChar != '\0'); }
It has exactly the same output. 'f', 'f', 'f' etc.
I've tried to look all across the forum (and the internet) for a way to print filenames from Bfile_FindWhatever, but it came out dry.
The primary goal by the end is to have something looking similar to the built-in memory management software.
Memory Management, for comparison.