From 003c0d2daeb00e219846cf1680a0c10d2133e88c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 2 Feb 2005 21:50:24 +0000 Subject: Make SH-specific code properly #ifdef'ed. We should consider doing these slightly nicer with function calls or something. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5746 a1c6a512-1295-4272-9138-f99709370657 --- apps/talk.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/talk.c b/apps/talk.c index 0d359844f9..e1f2c6f41b 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -242,9 +242,9 @@ static int shutup(void) { return 0; } - +#if CONFIG_CPU == SH7034 CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */ - +#endif /* search next frame boundary and continue up to there */ pos = search = mp3_get_pos(); end = queue[queue_read].buf + queue[queue_read].len; @@ -275,8 +275,10 @@ static int shutup(void) queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */ queue[queue_read].len = sent; /* current one ends after this */ +#if CONFIG_CPU == SH7034 DTCR3 = sent; /* let the DMA finish this frame */ CHCR3 |= 0x0001; /* re-enable DMA */ +#endif return 0; } } @@ -299,10 +301,10 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) if (!size) return 0; /* safety check */ - +#if CONFIG_CPU == SH7034 /* disable the DMA temporarily, to be safe of race condition */ CHCR3 &= ~0x0001; - +#endif queue_level = QUEUE_LEVEL; /* check old level */ if (queue_level < QUEUE_SIZE - 1) /* space left? */ @@ -324,7 +326,9 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) } else { +#if CONFIG_CPU == SH7034 CHCR3 |= 0x0001; /* re-enable DMA */ +#endif } return 0; -- cgit v1.2.3