summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sd-as3525.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-01-08 22:29:25 +0000
committerMichael Sevakis <jethead71@rockbox.org>2012-01-08 22:29:25 +0000
commit307cb049485cc20140b85aa78f8e2677e8df5851 (patch)
treeeaadfd7266e4e97e69bccd68655140dd9f1ef061 /firmware/target/arm/as3525/sd-as3525.c
parent5e21bbf5757163725f4bd2909fc7aaa548f61fc3 (diff)
downloadrockbox-307cb049485cc20140b85aa78f8e2677e8df5851.tar.gz
rockbox-307cb049485cc20140b85aa78f8e2677e8df5851.zip
AS3525v1/2: Enable nested handling of interrupts
Mostly for the sake of reducing latency for audio servicing where other service routines can take a long time to complete, leading to occasional drops of a few samples, especially in recording, where they are fairly frequent. One mystery that remains is GPIOA IRQ being interrupted causes strange undefined instruction exceptions, most easily produced on my Fuze V2 with a scrollwheel. Making GPIOA the top ISR for now, thus not interruptible, cures it. SVC mode is used during the actual calls. Hopefully the SVC stack size is sufficient. Prologue and epilogue code only uses the IRQ stack and is large enough. Any routine code that should not be interrupted should disable IRQ itself from here on in. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31642 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 17f1bfa11d..5bed36e51e 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -178,10 +178,12 @@ static int sd1_oneshot_callback(struct timeout *tmo)
void sd_gpioa_isr(void)
{
static struct timeout sd1_oneshot;
+
if (GPIOA_MIS & EXT_SD_BITS)
+ {
timeout_register(&sd1_oneshot, sd1_oneshot_callback, (3*HZ/10), 0);
- /* acknowledge interrupt */
- GPIOA_IC = EXT_SD_BITS;
+ GPIOA_IC = EXT_SD_BITS; /* acknowledge interrupt */
+ }
}
#endif /* HAVE_HOTSWAP */