summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-02 21:50:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-02 21:50:24 +0000
commit003c0d2daeb00e219846cf1680a0c10d2133e88c (patch)
treec255606c9acb7123d8b5d47bcecd54f6e3a8358d /apps
parentdb32fb131ef8f13f69ca25c262a4610bbc506535 (diff)
downloadrockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.zip
rockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.tar.gz
rockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.tar.bz2
rockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.tar.xz
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
Diffstat (limited to 'apps')
-rw-r--r--apps/talk.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 0d35984..e1f2c6f 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;