summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/ypr0/system-ypr0.c
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 /firmware/target/hosted/ypr0/system-ypr0.c
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 'firmware/target/hosted/ypr0/system-ypr0.c')
-rw-r--r--firmware/target/hosted/ypr0/system-ypr0.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/firmware/target/hosted/ypr0/system-ypr0.c b/firmware/target/hosted/ypr0/system-ypr0.c
index 3a2b30339f..bf3b1cd4c9 100644
--- a/firmware/target/hosted/ypr0/system-ypr0.c
+++ b/firmware/target/hosted/ypr0/system-ypr0.c
@@ -32,16 +32,11 @@
32 32
33#include "ascodec-target.h" 33#include "ascodec-target.h"
34 34
35void sim_do_exit(void) 35void power_off(void)
36{
37 exit(EXIT_SUCCESS);
38}
39
40void shutdown_hw(void)
41{ 36{
42 /* Something that we need to do before exit on our platform YPR0 */ 37 /* Something that we need to do before exit on our platform YPR0 */
43 ascodec_close(); 38 ascodec_close();
44 sim_do_exit(); 39 exit(EXIT_SUCCESS);
45} 40}
46 41
47uintptr_t *stackbegin; 42uintptr_t *stackbegin;
@@ -62,7 +57,7 @@ void system_init(void)
62 57
63void system_reboot(void) 58void system_reboot(void)
64{ 59{
65 sim_do_exit(); 60 power_off();
66} 61}
67 62
68void system_exception_wait(void) 63void system_exception_wait(void)