FIL *fsrc;
const u8 write_test[] = "write U-Disk OK!
";
void write_data_to_usb(u8* data_buffer, u8 data_len)
{
u8 res;
UINT bw;
//u32 file_size;
fsrc =(FIL*)mymalloc(SRAMIN,sizeof(FIL));
res = f_open(fsrc, "2:/test.txt" , FA_OPEN_ALWAYS| FA_READ | FA_WRITE);
if(res == 0)
{
f_lseek (fsrc , f_size(fsrc));
f_write(fsrc , data_buffer , data_len, &bw);
delay_ms (500);
}
myfree(SRAMIN, file);
f_close(fsrc);
}
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>