summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-12-31 13:34:56 +0000
committerThomas Martitz <kugel@rockbox.org>2011-12-31 13:34:56 +0000
commit05f12e08772d1ca03101b176e329bfd313daf673 (patch)
tree56ce125d3bd3c2c1d3e5588b2a3ddab1b8a460ab /apps
parent07605a659e06efaedb325e9a91214be503188f06 (diff)
downloadrockbox-05f12e08772d1ca03101b176e329bfd313daf673.tar.gz
rockbox-05f12e08772d1ca03101b176e329bfd313daf673.zip
ypr0: Enable battery voltage read-out, charging monitoring and charger detection.
Voltage can be read using as3543 adc (i.e. ascodec api, on this target implemented via ioctl()). TODO: Look into possibly controlling charging more by re-using powermgmt-ascodec.c. However, charging seems to be controlled by the kernel, so may not be needed. Charger state can be read using /dev/minivet. It allows to differentiate between wall charger and usb charging, but that's not implemented (is it even worthwhile?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31470 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c6
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 5773374d36..b4d917a3eb 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -58,7 +58,6 @@
58#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 58#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
59#include "disk.h" 59#include "disk.h"
60#include "adc.h" 60#include "adc.h"
61#include "power.h"
62#include "usb.h" 61#include "usb.h"
63#include "rtc.h" 62#include "rtc.h"
64#include "storage.h" 63#include "storage.h"
@@ -75,6 +74,7 @@
75#include "radio.h" 74#include "radio.h"
76#endif 75#endif
77#endif 76#endif
77#include "power.h"
78 78
79#ifdef HAVE_LCD_BITMAP 79#ifdef HAVE_LCD_BITMAP
80#include "scrollbar.h" 80#include "scrollbar.h"
@@ -900,7 +900,7 @@ static bool tsc2100_debug(void)
900 return simplelist_show_list(&info); 900 return simplelist_show_list(&info);
901} 901}
902#endif 902#endif
903#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 903#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0)
904#ifdef HAVE_LCD_BITMAP 904#ifdef HAVE_LCD_BITMAP
905/* 905/*
906 * view_battery() shows a automatically scaled graph of the battery voltage 906 * view_battery() shows a automatically scaled graph of the battery voltage
@@ -2168,7 +2168,7 @@ static const struct the_menu_item menuitems[] = {
2168 { "View CPU stats", dbg_cpuinfo }, 2168 { "View CPU stats", dbg_cpuinfo },
2169#endif 2169#endif
2170#ifdef HAVE_LCD_BITMAP 2170#ifdef HAVE_LCD_BITMAP
2171#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 2171#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0)
2172 { "View battery", view_battery }, 2172 { "View battery", view_battery },
2173#endif 2173#endif
2174#ifndef APPLICATION 2174#ifndef APPLICATION
diff --git a/apps/plugin.c b/apps/plugin.c
index 6dd84af775..f17ad3c57a 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -664,7 +664,7 @@ static const struct plugin_api rockbox_api = {
664 battery_level, 664 battery_level,
665 battery_level_safe, 665 battery_level_safe,
666 battery_time, 666 battery_time,
667#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 667#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0)
668 battery_voltage, 668 battery_voltage,
669#endif 669#endif
670#if CONFIG_CHARGING 670#if CONFIG_CHARGING
diff --git a/apps/plugin.h b/apps/plugin.h
index 3644e6468d..0bb7262bd8 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -794,7 +794,7 @@ struct plugin_api {
794 int (*battery_level)(void); 794 int (*battery_level)(void);
795 bool (*battery_level_safe)(void); 795 bool (*battery_level_safe)(void);
796 int (*battery_time)(void); 796 int (*battery_time)(void);
797#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 797#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0)
798 unsigned int (*battery_voltage)(void); 798 unsigned int (*battery_voltage)(void);
799#endif 799#endif
800#if CONFIG_CHARGING 800#if CONFIG_CHARGING