path: root/firmware/target/sh/archos/ondio
diff options
authorDave Chapman <>2007-09-04 08:03:07 +0000
committerDave Chapman <>2007-09-04 08:03:07 +0000
commit1672350378c1eb218db319e35e7bf8fa457b1142 (patch)
treeccffc78a046ce73aa8f49784d5b2a2d26a2bc4d6 /firmware/target/sh/archos/ondio
parent946a815cd4166f8761fac0c9cba0092b871cf900 (diff)
FS #7691 - improved USB detection on PP devices. This patch modifies the target-tree function usb_detect() on all targets from bool to int, returning USB_INSERTED or USB_EXTRACTED instead of true or false. This was done to enable the PP usb_detect() to check for USB_POWER (either a connection to a USB wall charger, or the user holding "charge mode" button) and return that as a third value.
git-svn-id: svn:// a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/sh/archos/ondio')
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/target/sh/archos/ondio/usb-ondio.c b/firmware/target/sh/archos/ondio/usb-ondio.c
index c856f3ae2c..b370fec3d9 100644
--- a/firmware/target/sh/archos/ondio/usb-ondio.c
+++ b/firmware/target/sh/archos/ondio/usb-ondio.c
@@ -23,10 +23,11 @@
#include "cpu.h"
#include "hwcompat.h"
#include "system.h"
+#include "usb.h"
-bool usb_detect(void)
+int usb_detect(void)
- return (adc_read(ADC_USB_POWER) <= 512) ? true : false;
+ return (adc_read(ADC_USB_POWER) <= 512) ? USB_INSERTED : USB_EXTRACTED;
void usb_enable(bool on)