usb_plugged() is PP only

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31489 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2011-12-31 18:43:59 +00:00
parent df09274768
commit 2115eac7bb
13 changed files with 14 additions and 33 deletions

View file

@ -112,7 +112,8 @@ void power_off(void)
unsigned int power_input_status(void)
{
return usb_plugged() ? POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
return (usb_detect == USB_INSERTED)
? POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
}
bool charging_state(void)

View file

@ -21,7 +21,7 @@
#include "powermgmt.h"
#include "power-imx233.h"
#include "usb-target.h"
#include "usb.h"
#include "string.h"
//#define LOGF_ENABLE
#include "logf.h"
@ -60,7 +60,7 @@ void powermgmt_init_target(void)
void charging_algorithm_step(void)
{
bool is_5v_present = usb_plugged();
bool is_5v_present = usb_detect() == USB_INSERTED;
/* initial state & 5v -> battery transition */
if(!is_5v_present && charge_state != DISCHARGING)

View file

@ -68,12 +68,7 @@ void usb_init_device(void)
int usb_detect(void)
{
return usb_plugged() ? USB_INSERTED : USB_EXTRACTED;
}
bool usb_plugged(void)
{
return !!(HW_POWER_STS & HW_POWER_STS__VBUSVALID);
return (HW_POWER_STS & HW_POWER_STS__VBUSVALID) ? USB_INSERTED : USB_EXTRACTED;
}
void usb_enable(bool on)

View file

@ -29,6 +29,5 @@
void usb_insert_int(void);
void usb_remove_int(void);
bool usb_plugged(void);
#endif /* USB_TARGET_H */