lets start… since i dont get anywhere the last days, trial and error, youtube, try to understand file.c, hard stuff,
Now I start to document the newbe way to awarness… ok I will expect this all — so no proof if this is true or false…
Problem:
the Blueprint for SD-Card - Filemanagement is: SEQV4(SVN) in all Variants,
too bad that that app is complex10 && because off its complexity the code is diffused as functions on different locations - and are referenced (include) in the main-loop (app.c)
so take a look at the top of the app.c:
#include "file.h"
#include "seq_file.h"
#include "seq_file_b.h"
#include "seq_file_g.h"
#include "seq_file_c.h"
#include "seq_file_gc.h"
#include "seq_file_hw.h"
#include "seq_file_m.h"
#include "seq_file_s.h"
#include "seq_file_bm.h"
file.h is a hEADER-File, all what is in there will be copied from the compiler in the app.c
i found there: definitions, types, prototypes which are importend for the FUNCTION “file.c”
–without these head you can CALL but nobody will hear…nobody will do, nothing will happen exept a error message from the compiler “not declared difintion…”
file.c :is a Function that is specified under “Modules”
if i write in app.c “FILE_CheckSDCard” the Function File.c get called “CheckSDCard”
File.c do then with that something and returns it something to app.c… all this Commands begin with “FILE_”
file.mk: aka MakeFile, normally when you build an hex-file you ask your compiler to “make” it, in this file -as far as i understand - is describet how-2-make-it…
I assume that i dont have to change anything in file.c/h/mk
ok now whats that, take a look @
seq_file.h, seq_file_b.h, seq_file_bm.h…
seq_file.c, seq_file_b.c, seq_file_bm.c…
I found in different application similar files (mbcv_file.h), I assume these are User/app files.
by looking in the Header files, they differ a bit some store Banks, some System Variables, but they are almost identical (…_file_a/a/c/d/e.h)
except for the first one those …_file.hÅ›
it define possible Error Codes that could come back if i call these _file_a/a/c/d/e.hÅ›
// used by seq_file_b.c
#define SEQ_FILE_B_ERR_INVALID_BANK -128 // invalid bank number
#define SEQ_FILE_B_ERR_INVALID_GROUP -129 // invalid group number
// used by seq_file_m.c
#define SEQ_FILE_M_ERR_INVALID_BANK -144 // invalid bank number
#define SEQ_FILE_M_ERR_INVALID_MAP -146 // invalid map number
// used by seq_file_bm.c
#define SEQ_FILE_BM_ERR_FORMAT -156 // invalid config file format
#define SEQ_FILE_BM_ERR_READ -157 // error while reading file (exact error status cannot be determined anymore)
—hm lets take a look @ app.c again, search for e.g.
SEQ_FILE_B_ERR_INVALID_BANK, SEQ_FILE_B_ERR_INVALID_GROUP, SEQ_FILE_BM_ERR_FORMAT
…nope nothing - am confuzed…
but results for:
SEQ_FILE_B_… like this: (SEQ_FILE_B_ none error)
...u8 bank;
for(bank=0; bank<4; ++bank)
str1[7+bank] = SEQ_FILE_B_NumPatterns(bank) ? ('1'+bank) : '-';
by searching the file.c module documentationi dont found any “NumPatterns”
I assume seq_file and file are more seperatet then i thougt (up to now i dont any clue anyway, trial and error)
… ok then take a look @ the seq_file_b.c; search for that “NumPatterns”
/////////////////////////////////////////////////////////////////////////////
// Returns number of patterns in bank // Returns 0 if bank not valid
s32 SEQ_FILE_B_NumPatterns(u8 bank){
if( (bank < SEQ_FILE_B_NUM_BANKS) && seq_file_b_info[bank].valid )
return seq_file_b_info[bank].header.num_patterns;
return 0;}
ok i can see clear now,
the seq_file_b.h define that error messages, that are User/App coded in the seq_file_b.c - these messages are callback messeges, which must be specified…
let me proove this by searching the seq_file.c yep here are those error messages:
/////////////////////////////////////////////////////////////////////////////
// create a complete bank file
// returns < 0 on errors (error codes are documented in seq_file.h)
s32 SEQ_FILE_B_Create(char *session, u8 bank){
if( bank >= SEQ_FILE_B_NUM_BANKS )
return SEQ_FILE_B_ERR_INVALID_BANK;
…_file_a/b/c/d.c are specific Memory Tasks, like SystemBank, PatternBank,SongBank, NameBank… whatever…
…_file.c manage all Memory Tasks, after booting or loading a “Master Preset” it comunicate with all Banks,
i expect this “manager” is needet to avoid multiple acces on the sdcard…
app.c then dont have to do much…
so now its time to code something stripped down , write a variable array on SD-Card & Recall it… & lets proove what is right and what not…
lets say if we need this triangle “dreifaltigkeit” or it can be done with app.c and _file_a/b/c/d.cÅ›