1
0
Fork 0
forked from len0rd/rockbox

Added power_off() and lowered the FULL limit

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1337 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-07-05 07:10:22 +00:00
parent c6de959f04
commit 4edf8aebf5
2 changed files with 17 additions and 1 deletions

View file

@ -72,6 +72,17 @@ void ide_power_enable(bool on)
#endif
}
void power_off(void)
{
#ifdef ARCHOS_RECORDER
PBDR &= ~PBDR_BTN_OFF;
PBIOR |= PBDR_BTN_OFF;
#else
PADR &= ~0x800;
PAIOR |= 0x800;
#endif
}
#else
bool charger_inserted(void)
@ -90,4 +101,8 @@ void charger_enable(bool on)
on = on;
}
void power_off(void)
{
}
#endif /* SIMULATOR */

View file

@ -21,13 +21,14 @@
#define BATTERY_LEVEL_SHUTDOWN (4500000 / BATTERY_SCALE_FACTOR) /* 4.5V */
#define BATTERY_LEVEL_DANGEROUS (4750000 / BATTERY_SCALE_FACTOR) /* 4.75V */
#define BATTERY_LEVEL_FULL (5550000 / BATTERY_SCALE_FACTOR) /* 5.55V */
#define BATTERY_LEVEL_FULL (5300000 / BATTERY_SCALE_FACTOR) /* 5.3V */
#define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_SHUTDOWN)
bool charger_inserted(void);
void charger_enable(bool on);
void ide_power_enable(bool on);
void power_off(void);
/* Returns battery level in percent */
int battery_level(void);