mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
hm60x: Fix charger detection.
Change-Id: Icde96e90303a9b6f3d399f3c25f24cc0b7d8576b
This commit is contained in:
parent
2d3c43dffe
commit
1060d30bdd
1 changed files with 10 additions and 2 deletions
|
|
@ -40,10 +40,18 @@ void power_init(void)
|
|||
|
||||
unsigned int power_input_status(void)
|
||||
{
|
||||
return (usb_detect() == USB_INSERTED) ? POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
|
||||
unsigned int status = POWER_INPUT_NONE;
|
||||
|
||||
if (!(GPIO_PADR & 0x80))
|
||||
status |= POWER_INPUT_MAIN_CHARGER;
|
||||
|
||||
if (usb_detect() == USB_INSERTED)
|
||||
status |= POWER_INPUT_USB_CHARGER;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool charging_state(void)
|
||||
{
|
||||
return true;
|
||||
return (bool)(!(GPIO_PADR & 0x80));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue