diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-24 16:58:41 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-24 16:58:41 +0000 |
commit | 3157e1395674a930c74e2ef4cc4ce78dffea8569 (patch) | |
tree | 5b2a9befc3b051caf0806995ebd32a5ab3bcf5ff /firmware/target/sh/archos/recorder/power-recorder.c | |
parent | 0f9729739f2fd90759c1caeca86e487c36f98834 (diff) | |
download | rockbox-3157e1395674a930c74e2ef4cc4ce78dffea8569.tar.gz rockbox-3157e1395674a930c74e2ef4cc4ce78dffea8569.zip |
Simplify powermgmt thread loops so it calls functions turn (no more power_thread_sleep). Do other target-friendly simplifications, generic battery switch handling and split sim-specific code. Whoever can, please verify charging on the Archos Recorder (due to change in the charger duty cycle code).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19579 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/sh/archos/recorder/power-recorder.c')
-rw-r--r-- | firmware/target/sh/archos/recorder/power-recorder.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/firmware/target/sh/archos/recorder/power-recorder.c b/firmware/target/sh/archos/recorder/power-recorder.c index d90c029890..8d7ea5fc51 100644 --- a/firmware/target/sh/archos/recorder/power-recorder.c +++ b/firmware/target/sh/archos/recorder/power-recorder.c | |||
@@ -25,9 +25,10 @@ | |||
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | #include "system.h" | 26 | #include "system.h" |
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "powermgmt-target.h" | ||
28 | #include "usb.h" | 29 | #include "usb.h" |
29 | 30 | ||
30 | bool charger_enabled; | 31 | static bool charger_on; |
31 | 32 | ||
32 | void power_init(void) | 33 | void power_init(void) |
33 | { | 34 | { |
@@ -48,13 +49,18 @@ void charger_enable(bool on) | |||
48 | if(on) | 49 | if(on) |
49 | { | 50 | { |
50 | and_b(~0x20, &PBDRL); | 51 | and_b(~0x20, &PBDRL); |
51 | charger_enabled = 1; | ||
52 | } | 52 | } |
53 | else | 53 | else |
54 | { | 54 | { |
55 | or_b(0x20, &PBDRL); | 55 | or_b(0x20, &PBDRL); |
56 | charger_enabled = 0; | ||
57 | } | 56 | } |
57 | |||
58 | charger_on = on; | ||
59 | } | ||
60 | |||
61 | bool charger_enabled(void) | ||
62 | { | ||
63 | return charger_on; | ||
58 | } | 64 | } |
59 | 65 | ||
60 | void ide_power_enable(bool on) | 66 | void ide_power_enable(bool on) |