From 5cf6b411ac8ac9f3a79a69b57db042a2c930b6b2 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sun, 28 Jul 2002 15:17:24 +0000 Subject: Added battery_level_safe() function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1480 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/power.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'firmware/drivers/power.c') diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index 9811d85c8e..1228942af1 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c @@ -51,6 +51,11 @@ int battery_level(void) return ((level-BATTERY_LEVEL_EMPTY) * 100) / BATTERY_RANGE; } +bool battery_level_safe(void) +{ + return adc_read(ADC_UNREG_POWER) > BATTERY_LEVEL_DANGEROUS; +} + void charger_enable(bool on) { #ifdef ARCHOS_RECORDER -- cgit v1.2.3