With the USBHostLite example I am a little confused on the Main_Write (void) Main_Read (void) calls, Main_Write says "This function is used by the user to write data to disk" and Main_Read says "This function is used by the user to read data from the disk"
It is a little confusing because the function reads data from the flash drive (or whatever mass storage device you are using) and puts it in the UserBuffer.(correct me if I am wrong please). So in turn Main_Write should data from the UserBuffer to the flash drive(to my understanding from the description).
Then why does Main_Write call the the same functions as Main_Read?? It seems to me that in main() if you call Main_Read and then Wain_Write it should perform the same task(roughly) at Main_copy.
I am sure I just don't understanding the purpose of the Main_read/Main_Write functions as they are not doing do what I expected. Can anyone clear it up? Thanks!
Content originally posted in LPCWare by tybls on Fri Jul 08 10:18:09 MST 2011 I had a feeling that the write function was not working properly as there is no reason to be opening the read file for a pure write command. Thanks zero.
Content originally posted in LPCWare by Ex-Zero on Fri Jul 08 08:17:59 MST 2011 Quote: tybls
I am sure I just don't understanding the purpose of the Main_read/Main_Write functions as they are not doing do what I expected. Can anyone clear it up? Thanks!
1. Main_Read is used to read your read file (FILENAME_R) to UserBuffer
2. Main_Copy is used to read your read file (FILENAME_R) to UserBuffer and then write UserBuffer to write file (FILENAME_W) 3. Main_Write is used to check if we have understood this and are able to reduce this nonsense to something working like: