forked from len0rd/rockbox
i7: pcm-telechips fix sampling rate that was about 40000 instead of 44100
- remove test case
- remove trailing spaces
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22761 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
72578ef558
commit
14ac374ffe
1 changed files with 12 additions and 74 deletions
|
|
@ -27,9 +27,6 @@
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "pcm.h"
|
#include "pcm.h"
|
||||||
|
|
||||||
/* Just for tests enable it to play simple tone */
|
|
||||||
//#define PCM_TELECHIPS_TEST
|
|
||||||
|
|
||||||
struct dma_data
|
struct dma_data
|
||||||
{
|
{
|
||||||
/* NOTE: The order of size and p is important if you use assembler
|
/* NOTE: The order of size and p is important if you use assembler
|
||||||
|
|
@ -85,8 +82,9 @@ void pcm_play_dma_init(void)
|
||||||
DAMR = 0x3c8e80;
|
DAMR = 0x3c8e80;
|
||||||
#elif defined(IAUDIO_7)
|
#elif defined(IAUDIO_7)
|
||||||
BCLKCTR &= ~DEV_DAI;
|
BCLKCTR &= ~DEV_DAI;
|
||||||
PCLK_DAI = (0x800b << 16) | (PCLK_DAI & 0xffff);
|
PCLK_DAI = (0x800a << 16) | (PCLK_DAI & 0xffff);
|
||||||
BCLKCTR |= DEV_DAI;
|
BCLKCTR |= DEV_DAI;
|
||||||
|
|
||||||
/* Master mode, 256->64fs, 16bit LSB*/
|
/* Master mode, 256->64fs, 16bit LSB*/
|
||||||
DAMR = 0x3cce20;
|
DAMR = 0x3cce20;
|
||||||
#elif defined(LOGIK_DAX)
|
#elif defined(LOGIK_DAX)
|
||||||
|
|
@ -360,68 +358,8 @@ void fiq_handler(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TODO: required by wm8531 codec, why not to implement */
|
/* TODO: required by wm8731 codec */
|
||||||
void i2s_reset(void)
|
void i2s_reset(void)
|
||||||
{
|
{
|
||||||
/* DAMR = 0; */
|
/* DAMR = 0; */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PCM_TELECHIPS_TEST
|
|
||||||
#include "lcd.h"
|
|
||||||
#include "sprintf.h"
|
|
||||||
#include "backlight-target.h"
|
|
||||||
|
|
||||||
static int frame = 0;
|
|
||||||
static void test_callback_for_more(unsigned char **start, size_t *size)
|
|
||||||
{
|
|
||||||
static unsigned short data[8];
|
|
||||||
static int cntr = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 8; i ++) {
|
|
||||||
unsigned short val;
|
|
||||||
|
|
||||||
if (0x100 == (cntr & 0x100))
|
|
||||||
val = 0x0fff;
|
|
||||||
else
|
|
||||||
val = 0x0000;
|
|
||||||
data[i] = val;
|
|
||||||
cntr++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*start = data;
|
|
||||||
*size = sizeof(data);
|
|
||||||
|
|
||||||
frame++;
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_telechips_test(void)
|
|
||||||
{
|
|
||||||
static char buf[100];
|
|
||||||
unsigned char *data;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
_backlight_on();
|
|
||||||
|
|
||||||
audiohw_preinit();
|
|
||||||
pcm_play_dma_init();
|
|
||||||
pcm_postinit();
|
|
||||||
|
|
||||||
audiohw_mute(false);
|
|
||||||
audiohw_set_master_vol(0x7f, 0x7f);
|
|
||||||
|
|
||||||
pcm_callback_for_more = test_callback_for_more;
|
|
||||||
test_callback_for_more(&data, &size);
|
|
||||||
pcm_play_dma_start(data, size);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
int line = 0;
|
|
||||||
lcd_clear_display();
|
|
||||||
lcd_puts(0, line++, __func__);
|
|
||||||
snprintf(buf, sizeof(buf), "frame: %d", frame);
|
|
||||||
lcd_puts(0, line++, buf);
|
|
||||||
lcd_update();
|
|
||||||
sleep(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue