void mp3_play_song(uint8_t *pname)
{
uint16_t br, bw;
uint8_t res, resw;
uint16_t i=0;
u16 temp;
res = f_open(&fmp3, (const TCHAR*)pname, FA_READ);
if(res != resflag)
{
resflag = res;
printf("res = %d \r\n", res);
}
if(res==0)
{
VS_SPI_SpeedHigh();
while(1)
{
delayvar += 1;
if(delayvar >= 10)
{
VS_Set_Vol(100); 一运行到这行播放就停止!!!
temp = VS_RD_Reg(SPI_MODE);
if(delayvar > 20)
{
delayvar = 0;
VS_Set_Vol(220);
}
}
res=f_read(&fmp3, databuf, num2read, (UINT*)&br);
i=0;
do
{
if(VS_Send_MusicData(databuf+i)==0)
{
i+=32;
}
}while(i<num2read);
if(br!=num2read||res!=0)
{
break;
}
}
}
f_close(&fmp3);
}
我查看了MODE寄存器,是0x0800,请各位大神指导 |