forked from len0rd/rockbox
Fix FS#9926 - On Photo and Color iPods, correct check for whether battery is charging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20752 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
01ada299a3
commit
88b509b7d2
1 changed files with 9 additions and 0 deletions
|
|
@ -77,7 +77,16 @@ unsigned int power_input_status(void)
|
|||
|
||||
/* Returns true if the unit is charging the batteries. */
|
||||
bool charging_state(void) {
|
||||
#if defined(IPOD_COLOR)
|
||||
/* 0x70000088 appears to be the input value for GPO32 bits.
|
||||
Write a zero to 0x70000088 before reading.
|
||||
To enable input set the corresponding 0x7000008C bit,
|
||||
and clear the corresponding GPO32_ENABLE bit. */
|
||||
outl(0, 0x70000088);
|
||||
return (inl(0x70000088) & 1)?false:true;
|
||||
#else
|
||||
return (GPIOB_INPUT_VAL & 0x01)?false:true;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_CHARGING */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue