This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

tm4c1294 用自带的PHY读取U盘的速度问题



通过记录程序运行时间前后的系统定时器时间来简单记录运行时间,运行一次以下程序需要时间260ms,其中g_T_LedFile_Info.layfile_head.numCtrl 为180,g_T_arr_LayCtrl_Info[count].data_len全为900,这个时间是否正常呢,能否缩短时间呢,也就是能不能读取的更快点,可以的话需要修改哪些地方呢,fatfs系统移植的是最新

for(count = 0; count < g_T_LedFile_Info.layfile_head.numCtrl; count++) //播放一帧的数据
{

if(g_Eff_File_ReadCursor + g_T_arr_LayCtrl_Info[count].data_len < g_T_File_Info.fsize) //光标后移后,小于总文件大小
{
res2 = f_read(g_T_LedFile_Info.file, g_T_LedFile_Info.efffile_buf, g_T_arr_LayCtrl_Info[count].data_len, &g_Byte_Read); //读取一帧数据
g_Eff_File_ReadCursor += g_T_arr_LayCtrl_Info[count].data_len; //光标指针后移一帧的字节数
send_len = g_T_arr_LayCtrl_Info[count].data_len; //数据长度
g_Current_Frame++;
}
else
{
tlen = g_T_File_Info.fsize - g_Eff_File_ReadCursor; //计算剩下不足一帧的字节数
res2 = f_read(g_T_LedFile_Info.file, g_T_LedFile_Info.efffile_buf, tlen, &g_Byte_Read); //读取剩余数据
g_Eff_File_ReadCursor = g_EffFile_HeadSize; //光标转到文件头字节后,准备重头开始播放
send_len = tlen;
end_play = 1; //文件读取到最后
g_Current_Frame++;
}
}