初级会员

- 积分
- 83
- 金钱
- 83
- 注册时间
- 2016-5-14
- 在线时间
- 14 小时
|
[mw_shl_code=applescript,true]/**
* @brief 获取文件名
* @param none
* @retval error 出错 success 成功
* @notice 外部调用
*/
void Get_File_Name(u8 *GetName)
{
FRESULT res;
u16 index = 0;
while(index < 0xffff)
{
sprintf((char *)GetName , "1:%d.wav",index);//得到這个文件名
res = f_open(&fsrc , (const TCHAR*)GetName,FA_READ);//尝试打开這个文件
if(res == FR_NO_FILE)
{
break;
}
index++;
}
}[/mw_shl_code]
这段程序会在
sprintf函数那里死机进入硬件故障中断(非法操作内存)
[mw_shl_code=applescript,true]void HardFault_Handler(void)
{
/* Go to infinite loop when Hard Fault exception occurs */
while (1)
{
}
}[/mw_shl_code]
|
|