summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-04-18 18:52:11 +0000
committerJens Arnold <amiconn@rockbox.org>2008-04-18 18:52:11 +0000
commita73b13cfff4e98d050fdcb93ac041cd82d01ffd7 (patch)
tree4b2a0da81af4bbbead4f29f1dedd649f4f2fbf05
parent3dcb4ff97fcd8c8fdb438ae60aa1747b69ab9110 (diff)
downloadrockbox-a73b13cfff4e98d050fdcb93ac041cd82d01ffd7.tar.gz
rockbox-a73b13cfff4e98d050fdcb93ac041cd82d01ffd7.tar.bz2
rockbox-a73b13cfff4e98d050fdcb93ac041cd82d01ffd7.zip
Fix ticking noise on PP5002 introduced with tthe transfer optimisation in r17097.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17158 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/pcm-pp.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index 489862e5de..a0ab91e6ef 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -107,17 +107,18 @@ void pcm_apply_settings(void)
pcm_curr_sampr = pcm_freq;
}
-/* ASM optimised FIQ handler. Checks for the minimum allowed loop cycles by evalutation of
- * free IISFIFO-slots against available source buffer words. Through this it is possible to
- * move the check for IIS_TX_FREE_COUNT outside the loop and do some further optimization.
- * Right after the loops (source buffer -> IISFIFO) are done we need to check whether we
- * have to exit FIQ handler (this must be done, if all free FIFO slots were filled) or
- * we will have to get some new source data.
- * Important information kept from former ASM implementation (not used anymore): GCC fails
- * to make use of the fact that FIQ mode has registers r8-r14 banked, and so does not need
- * to be saved. This routine uses only these registers, and so will never touch the stack
- * unless it actually needs to do so when calling pcm_callback_for_more. C version is still
- * included below for reference and testing.
+/* ASM optimised FIQ handler. Checks for the minimum allowed loop cycles by
+ * evalutation of free IISFIFO-slots against available source buffer words.
+ * Through this it is possible to move the check for IIS_TX_FREE_COUNT outside
+ * the loop and do some further optimization. Right after the loops (source
+ * buffer -> IISFIFO) are done we need to check whether we have to exit FIQ
+ * handler (this must be done, if all free FIFO slots were filled) or we will
+ * have to get some new source data. Important information kept from former
+ * ASM implementation (not used anymore): GCC fails to make use of the fact
+ * that FIQ mode has registers r8-r14 banked, and so does not need to be saved.
+ * This routine uses only these registers, and so will never touch the stack
+ * unless it actually needs to do so when calling pcm_callback_for_more.
+ * C version is still included below for reference and testing.
*/
#if 1
void fiq_playback(void) ICODE_ATTR __attribute__((naked));
@@ -169,8 +170,9 @@ void fiq_playback(void)
".check_fifo: \n"
"ldr r0, [r10, %[cfg]] \n" /* read IISFIFO_CFG to check FIFO status */
"and r0, r0, %[mask] \n" /* r0 = IIS_TX_FREE_COUNT << 23 (PP5002) */
-
- "mov r1, r0, lsr #24 \n" /* number of free pairs of FIFO slots */
+
+ "movs r1, r0, lsr #24 \n" /* number of free pairs of FIFO slots */
+ "beq .exit \n" /* no complete pair? -> exit */
"cmp r1, r9, lsr #2 \n" /* number of words from source */
"movgt r1, r9, lsr #2 \n" /* r1 = amount of allowed loops */
"sub r9, r9, r1, lsl #2 \n" /* r1 words will be written in following loop */