summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2008-12-29 23:32:11 +0000
committerBjörn Stenberg <bjorn@haxx.se>2008-12-29 23:32:11 +0000
commitf2d2b8c3c78281c0397c27d43921c945655818eb (patch)
tree775157d740b02eb3b488057b83a2cc6d01d0f5e9 /firmware
parent679d2c11d1c0b790a389b01aaab73b6c18761ada (diff)
Added usb_detect() for Clip, Fuze, E200v2 and C200v2.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19614 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/usb-as3525.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/usb-as3525.c b/firmware/target/arm/as3525/usb-as3525.c
index b151d5061a..ab2f51e72f 100644
--- a/firmware/target/arm/as3525/usb-as3525.c
+++ b/firmware/target/arm/as3525/usb-as3525.c
@@ -21,6 +21,7 @@
#include "usb.h"
#include "power.h"
+#include "as3525.h"
#include <stdbool.h>
void usb_enable(bool on)
@@ -35,6 +36,14 @@ void usb_init_device(void)
int usb_detect(void)
{
+#if defined(SANSA_CLIP)
+ return !GPIOA_PIN(6);
+#elif defined(SANSA_FUZE) || defined(SANSA_E200V2)
+ return !GPIOA_PIN(3);
+#elif defined(SANSA_C200V2)
+ return !GPIOA_PIN(1);
+#else
/* TODO: Implement USB detection */
return USB_EXTRACTED;
+#endif
}