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(&quot;write error:%d\r\n&quot;,res);
}else
res=f_write(f_rec,i2srecbuf2,I2S_RX_DMA_BUF_SIZE,(UINT*)&bw);//D′è????t
if(res)
printf(&quot;write error:%d\r\n&quot;,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í£
//?1???aê???ò?
recsec=0recoder_new_pathname(pname);//μ?μ?D?μ???×?
Show_Str(30,190,lcddev.width,16,&quot;????:&quot;,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; |