void rec_i2s_dma_rx_callback(void)
{
u16 bw;
u8 res;
if(rec_sta==0X80)//??ò??£ê?
{
if(DMA1_Stream3->CR&(1<<19))
{
res=f_write(f_rec,i2srecbuf1,I2S_RX_DMA_BUF_SIZE,(UINT*)&bw);//D′è????t
if(res)
{
printf("write error:%d
",res);
}
}else
{
res=f_write(f_rec,i2srecbuf2,I2S_RX_DMA_BUF_SIZE,(UINT*)&bw);//D′è????t
if(res)
{
printf("write error:%d
",res);
}
}
wavsize+=I2S_RX_DMA_BUF_SIZE;
}
}
case KEY0_PRES: //REC/PAUSE
if(rec_sta&0X01)//?-à′ê??Yí£,?ìD???ò?
{
rec_sta&=0XFE;//è????Yí£
}else if(rec_sta&0X80)//ò??-?ú??ò?á?,?Yí£
{
rec_sta|=0X01; //?Yí£
}else //?1???aê???ò?
{
recsec=0;
recoder_new_pathname(pname); //μ?μ?D?μ???×?
Show_Str(30,190,lcddev.width,16,"????:",16,0);
Show_Str(30+40,190,lcddev.width,16,pname+11,16,0);//??ê?μ±?°??ò????t??×?
recoder_wav_init(wavhead); //3?ê??ˉwavêy?Y
res=f_open(f_rec,(const TCHAR*)pname, FA_CREATE_ALWAYS | FA_WRITE);
if(res) //???t′′?¨ê§°ü
{
rec_sta=0; //′′?¨???t꧰ü,2??ü??ò?
rval=0XFE; //ìáê?ê?·?′??úSD?¨
}else
{
res=f_write(f_rec,(const void*)wavhead,sizeof(__WaveHeader),&bw);//D′è?í·êy?Y
recoder_msg_show(0,0);
rec_sta|=0X80; //?aê???ò?
}
}
if(rec_sta&0X01)LED1=0; //ìáê??y?ú?Yí£
else LED1=1;
break;
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
具体见http://www.openedv.com/forum.php ... &extra=page%3D1
一周热门 更多>