diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-02-02 21:50:24 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-02-02 21:50:24 +0000 |
commit | 003c0d2daeb00e219846cf1680a0c10d2133e88c (patch) | |
tree | c255606c9acb7123d8b5d47bcecd54f6e3a8358d | |
parent | db32fb131ef8f13f69ca25c262a4610bbc506535 (diff) | |
download | rockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.tar.gz rockbox-003c0d2daeb00e219846cf1680a0c10d2133e88c.zip |
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
-rw-r--r-- | apps/talk.c | 12 |
1 files changed, 8 insertions, 4 deletions
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) | |||
242 | { | 242 | { |
243 | return 0; | 243 | return 0; |
244 | } | 244 | } |
245 | 245 | #if CONFIG_CPU == SH7034 | |
246 | CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */ | 246 | CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */ |
247 | 247 | #endif | |
248 | /* search next frame boundary and continue up to there */ | 248 | /* search next frame boundary and continue up to there */ |
249 | pos = search = mp3_get_pos(); | 249 | pos = search = mp3_get_pos(); |
250 | end = queue[queue_read].buf + queue[queue_read].len; | 250 | end = queue[queue_read].buf + queue[queue_read].len; |
@@ -275,8 +275,10 @@ static int shutup(void) | |||
275 | queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */ | 275 | queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */ |
276 | queue[queue_read].len = sent; /* current one ends after this */ | 276 | queue[queue_read].len = sent; /* current one ends after this */ |
277 | 277 | ||
278 | #if CONFIG_CPU == SH7034 | ||
278 | DTCR3 = sent; /* let the DMA finish this frame */ | 279 | DTCR3 = sent; /* let the DMA finish this frame */ |
279 | CHCR3 |= 0x0001; /* re-enable DMA */ | 280 | CHCR3 |= 0x0001; /* re-enable DMA */ |
281 | #endif | ||
280 | return 0; | 282 | return 0; |
281 | } | 283 | } |
282 | } | 284 | } |
@@ -299,10 +301,10 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) | |||
299 | 301 | ||
300 | if (!size) | 302 | if (!size) |
301 | return 0; /* safety check */ | 303 | return 0; /* safety check */ |
302 | 304 | #if CONFIG_CPU == SH7034 | |
303 | /* disable the DMA temporarily, to be safe of race condition */ | 305 | /* disable the DMA temporarily, to be safe of race condition */ |
304 | CHCR3 &= ~0x0001; | 306 | CHCR3 &= ~0x0001; |
305 | 307 | #endif | |
306 | queue_level = QUEUE_LEVEL; /* check old level */ | 308 | queue_level = QUEUE_LEVEL; /* check old level */ |
307 | 309 | ||
308 | if (queue_level < QUEUE_SIZE - 1) /* space left? */ | 310 | if (queue_level < QUEUE_SIZE - 1) /* space left? */ |
@@ -324,7 +326,9 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) | |||
324 | } | 326 | } |
325 | else | 327 | else |
326 | { | 328 | { |
329 | #if CONFIG_CPU == SH7034 | ||
327 | CHCR3 |= 0x0001; /* re-enable DMA */ | 330 | CHCR3 |= 0x0001; /* re-enable DMA */ |
331 | #endif | ||
328 | } | 332 | } |
329 | 333 | ||
330 | return 0; | 334 | return 0; |