diff options
author | Dave Chapman <dave@dchapman.com> | 2007-09-04 08:03:07 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-09-04 08:03:07 +0000 |
commit | 1672350378c1eb218db319e35e7bf8fa457b1142 (patch) | |
tree | ccffc78a046ce73aa8f49784d5b2a2d26a2bc4d6 /firmware/target/coldfire/iriver | |
parent | 946a815cd4166f8761fac0c9cba0092b871cf900 (diff) | |
download | rockbox-1672350378c1eb218db319e35e7bf8fa457b1142.tar.gz rockbox-1672350378c1eb218db319e35e7bf8fa457b1142.zip |
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
Diffstat (limited to 'firmware/target/coldfire/iriver')
-rw-r--r-- | firmware/target/coldfire/iriver/h100/usb-h100.c | 5 | ||||
-rw-r--r-- | firmware/target/coldfire/iriver/h300/usb-h300.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/firmware/target/coldfire/iriver/h100/usb-h100.c b/firmware/target/coldfire/iriver/h100/usb-h100.c index 3b00e967da..5a2f7f500b 100644 --- a/firmware/target/coldfire/iriver/h100/usb-h100.c +++ b/firmware/target/coldfire/iriver/h100/usb-h100.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "cpu.h" | 21 | #include "cpu.h" |
22 | #include "system.h" | 22 | #include "system.h" |
23 | #include "kernel.h" | 23 | #include "kernel.h" |
24 | #include "usb.h" | ||
24 | 25 | ||
25 | void usb_init_device(void) | 26 | void usb_init_device(void) |
26 | { | 27 | { |
@@ -30,9 +31,9 @@ void usb_init_device(void) | |||
30 | or_l(0x01000040, &GPIO_FUNCTION); | 31 | or_l(0x01000040, &GPIO_FUNCTION); |
31 | } | 32 | } |
32 | 33 | ||
33 | bool usb_detect(void) | 34 | int usb_detect(void) |
34 | { | 35 | { |
35 | return (GPIO1_READ & 0x80)?true:false; | 36 | return (GPIO1_READ & 0x80) ? USB_INSERTED : USB_EXTRACTED; |
36 | } | 37 | } |
37 | 38 | ||
38 | void usb_enable(bool on) | 39 | void usb_enable(bool on) |
diff --git a/firmware/target/coldfire/iriver/h300/usb-h300.c b/firmware/target/coldfire/iriver/h300/usb-h300.c index d08cc24dba..d50b7bc808 100644 --- a/firmware/target/coldfire/iriver/h300/usb-h300.c +++ b/firmware/target/coldfire/iriver/h300/usb-h300.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "cpu.h" | 21 | #include "cpu.h" |
22 | #include "system.h" | 22 | #include "system.h" |
23 | #include "kernel.h" | 23 | #include "kernel.h" |
24 | #include "usb.h" | ||
24 | 25 | ||
25 | void usb_init_device(void) | 26 | void usb_init_device(void) |
26 | { | 27 | { |
@@ -35,9 +36,9 @@ void usb_init_device(void) | |||
35 | or_l(0x03000000, &GPIO_FUNCTION); | 36 | or_l(0x03000000, &GPIO_FUNCTION); |
36 | } | 37 | } |
37 | 38 | ||
38 | bool usb_detect(void) | 39 | int usb_detect(void) |
39 | { | 40 | { |
40 | return (GPIO1_READ & 0x80)?true:false; | 41 | return (GPIO1_READ & 0x80) ? USB_INSERTED : USB_EXTRACTED; |
41 | } | 42 | } |
42 | 43 | ||
43 | void usb_enable(bool on) | 44 | void usb_enable(bool on) |