Hello to one and all!
I have an array of integers which i want to write to pendrive.In USB hostlite for lpc2468,the main_write() function should be called for this purpose according to my understanding.But,the function first opens a file "MSREAD.TXT", reads it, stores its contents in an area called user buffer which starts at 0x7FD00000+1000 this address. I don't understand why we should read the contents of user buffer and then write it? Isn't that same as MAIN_Copy()? What should I do to write the array to the Pendrive? I tried to store array on the area of userbuffer having a thought that the function would write from userbuffer only, but we didn't get success.The error is logical, because instead of showing the array,it shows something else.
kindly tell me that what should I do to write any data I wish to USB...?
> I have an array of integers which i want to write to pendrive
As usual calling sequence of file system, 1) Open a file: FILE_Open() 2) Write data to the file: FILE_Write() 3) Close the file: FILE_Close()
Don't forget to call FILE_Close() ;-)
Tsuneo
Sir, the file_write() function teakes the data from the user buffer to write to the pendrive... how should i put the values of my array into the user buffer and where..?
> file_write() function teakes the data from the user buffer to write to the pendrive…
FILE_Write() takes data from a buffer pointer of its argument. If you would see unexpected data on the file, you should pass a wrong buffer pointer to FILE_Write().