mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Tweak some PCM drivers for less typecasting with the data pointer.
Yeah, sizeof (void) here with GCC is 1. If something has a problem with that, we'll set it straight. Change-Id: I9ad3eee75dd440f6404a04a501d1533c8bc18ba9
This commit is contained in:
parent
f6e17e86fe
commit
cd8e11b463
6 changed files with 22 additions and 24 deletions
|
|
@ -43,9 +43,9 @@
|
|||
static volatile int locked = 0;
|
||||
static const int zerosample = 0;
|
||||
static unsigned char dblbuf[1024] IBSS_ATTR;
|
||||
static const unsigned char* queuedbuf;
|
||||
static const void* queuedbuf;
|
||||
static size_t queuedsize;
|
||||
static const unsigned char* nextbuf;
|
||||
static const void* nextbuf;
|
||||
static size_t nextsize;
|
||||
|
||||
static const struct div_entry {
|
||||
|
|
@ -116,8 +116,8 @@ void INT_DMA(void)
|
|||
{
|
||||
if (!nextsize)
|
||||
{
|
||||
new_buffer = pcm_play_dma_complete_callback(PCM_DMAST_OK,
|
||||
(const void**)&nextbuf, &nextsize);
|
||||
new_buffer = pcm_play_dma_complete_callback(
|
||||
PCM_DMAST_OK, &nextbuf, &nextsize);
|
||||
if (!new_buffer)
|
||||
break;
|
||||
}
|
||||
|
|
@ -144,7 +144,7 @@ void INT_DMA(void)
|
|||
void pcm_play_dma_start(const void* addr, size_t size)
|
||||
{
|
||||
/* DMA channel on */
|
||||
nextbuf = (const unsigned char*)addr;
|
||||
nextbuf = addr;
|
||||
nextsize = size;
|
||||
queuedsize = 0;
|
||||
DMABASE0 = (unsigned int)(&zerosample);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ static unsigned char dblbuf[2][PCM_WATERMARK * 4];
|
|||
static int active_dblbuf;
|
||||
struct dma_lli pcm_lli[PCM_LLICOUNT] __attribute__((aligned(16)));
|
||||
static struct dma_lli* lastlli;
|
||||
static const unsigned char* dataptr;
|
||||
static const void* dataptr;
|
||||
size_t pcm_remaining;
|
||||
size_t pcm_chunksize;
|
||||
|
||||
|
|
@ -65,8 +65,7 @@ void INT_DMAC0C0(void)
|
|||
DMAC0INTTCCLR = 1;
|
||||
if (!pcm_remaining)
|
||||
{
|
||||
pcm_play_dma_complete_callback(PCM_DMAST_OK, (const void**)&dataptr,
|
||||
&pcm_remaining);
|
||||
pcm_play_dma_complete_callback(PCM_DMAST_OK, &dataptr, &pcm_remaining);
|
||||
pcm_chunksize = pcm_remaining;
|
||||
}
|
||||
if (!pcm_remaining)
|
||||
|
|
@ -121,7 +120,7 @@ void INT_DMAC0C0(void)
|
|||
|
||||
void pcm_play_dma_start(const void* addr, size_t size)
|
||||
{
|
||||
dataptr = (const unsigned char*)addr;
|
||||
dataptr = addr;
|
||||
pcm_remaining = size;
|
||||
I2STXCOM = 0xe;
|
||||
INT_DMAC0C0();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue