File system
Posted: Tue Dec 20, 2016 8:25 am
I have run example program EFF-FPT on a MOD5441X, and it runs fine. But I'm trying to understand why/how the following snippet of code works.
In UserMain(), part of the initialization is this:
I understand that each task must call f_enterFS() in order to access the file system. What I don't understand is
why calling OSChangePrio() causes the following call to f_enterFS() to be part of the FTP Task, especially since the FTP
Task hasn't even been started yet. That doesn't happen until later on in the initialization process.
Also, does changing the priority for UserMain have to follow the FTP priority change? Could main's priority have been changed before changing FTP's?
In addition, as I'm going through the code for the example program, in function FTPD_SendFileToClient() (ftp_f.cpp) there are a
series of conditional compiles based on the type of device being accessed. All the conditional compile sections
have this same construct:
Every code section returns a fail code without testing the return of the change directory call. Is this correct?
In UserMain(), part of the initialization is this:
Code: Select all
f_enterFS();
// We now must also enter the file system for the FTP task
OSChangePrio( FTP_PRIO );
f_enterFS();
OSChangePrio( MAIN_PRIO );
why calling OSChangePrio() causes the following call to f_enterFS() to be part of the FTP Task, especially since the FTP
Task hasn't even been started yet. That doesn't happen until later on in the initialization process.
Also, does changing the priority for UserMain have to follow the FTP priority change? Could main's priority have been changed before changing FTP's?
In addition, as I'm going through the code for the example program, in function FTPD_SendFileToClient() (ftp_f.cpp) there are a
series of conditional compiles based on the type of device being accessed. All the conditional compile sections
have this same construct:
Code: Select all
#ifdef USE_MMC
if ( strcmp( file_name, "_mmc" ) == 0 )
{
//iprintf( "Change to MMC.\r\n" );
f_chdrive( MMC_DRV_NUM );
return( FTPD_FAIL );
}
#endif /* USE_MMC */