From 1672350378c1eb218db319e35e7bf8fa457b1142 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Tue, 4 Sep 2007 08:03:07 +0000 Subject: 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://svn.rockbox.org/rockbox/trunk@14600 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/sh/archos/recorder/usb-recorder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'firmware/target/sh/archos/recorder/usb-recorder.c') diff --git a/firmware/target/sh/archos/recorder/usb-recorder.c b/firmware/target/sh/archos/recorder/usb-recorder.c index 7ed237068e..dfa8462203 100644 --- a/firmware/target/sh/archos/recorder/usb-recorder.c +++ b/firmware/target/sh/archos/recorder/usb-recorder.c @@ -22,10 +22,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) > 500) ? true : false; + return (adc_read(ADC_USB_POWER) > 500) ? USB_INSERTED : USB_EXTRACTED; } void usb_enable(bool on) -- cgit v1.2.3