提交 f20ed9bb 编写于 作者: K kyle.hu.gz

Fixed sample rate not set correctly under slave I2S mode.

Fixed string corruption problem in radio_list_update.c.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@528 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 c7aea05b
......@@ -169,7 +169,7 @@ static void DMA_Configuration(rt_uint32_t addr, rt_size_t size)
DMA_Cmd(CODEC_I2S_DMA, ENABLE);
}
static void I2S_Configuration(void)
static void I2S_Configuration(uint32_t I2S_AudioFreq)
{
I2S_InitTypeDef I2S_InitStructure;
......@@ -177,7 +177,7 @@ static void I2S_Configuration(void)
I2S_InitStructure.I2S_Standard = I2S_Standard_Phillips;
I2S_InitStructure.I2S_DataFormat = I2S_DataFormat_16b;
I2S_InitStructure.I2S_MCLKOutput = I2S_MCLKOutput_Disable;
I2S_InitStructure.I2S_AudioFreq = I2S_AudioFreq_44k;
I2S_InitStructure.I2S_AudioFreq = I2S_AudioFreq;
I2S_InitStructure.I2S_CPOL = I2S_CPOL_Low;
/* I2S2 configuration */
......@@ -404,6 +404,11 @@ rt_err_t sample_rate(int sr)
}
codec_send(r06);
codec_send(r07);
#if !CODEC_MASTER_MODE
I2S_Configuration((uint32_t) sr);
#endif
return RT_EOK;
}
......@@ -556,7 +561,7 @@ rt_err_t codec_hw_init(void)
NVIC_Configuration();
GPIO_Configuration();
I2S_Configuration();
I2S_Configuration(I2S_AudioFreq_44k);
dev = (rt_device_t) &codec;
dev->type = RT_Device_Class_Sound;
......
......@@ -202,7 +202,7 @@ void update_radio_list_req(void)
update_radio_list_state = UPDATE_RAIDO_LIST_PROC;
request.type = PLAYER_REQUEST_UPDATE_RADIO_LIST;
ch = strncpy(request.fn, RADIO_LIST_UPDATE_URL, strlen(RADIO_LIST_UPDATE_URL));
ch = strcpy(request.fn, RADIO_LIST_UPDATE_URL);
/* send to message queue */
rt_mq_send(update_radio_mq, (void*)&request, sizeof(struct player_request));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册