summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-24 16:58:41 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-24 16:58:41 +0000
commit3157e1395674a930c74e2ef4cc4ce78dffea8569 (patch)
tree5b2a9befc3b051caf0806995ebd32a5ab3bcf5ff /firmware/target/arm/s3c2440/gigabeat-fx
parent0f9729739f2fd90759c1caeca86e487c36f98834 (diff)
downloadrockbox-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/arm/s3c2440/gigabeat-fx')
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/powermgmt-meg-fx.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/powermgmt-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/powermgmt-meg-fx.c
index 6522e6534b..49f7e2e049 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/powermgmt-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/powermgmt-meg-fx.c
@@ -19,9 +19,10 @@
19 * KIND, either express or implied. 19 * KIND, either express or implied.
20 * 20 *
21 ****************************************************************************/ 21 ****************************************************************************/
22
23#include "config.h" 22#include "config.h"
23#include "system.h"
24#include "adc.h" 24#include "adc.h"
25#include "power.h"
25#include "powermgmt.h" 26#include "powermgmt.h"
26 27
27const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 28const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
@@ -58,3 +59,17 @@ unsigned int battery_adc_voltage(void)
58 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; 59 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
59} 60}
60 61
62unsigned int input_millivolts(void)
63{
64
65 unsigned int batt_millivolts = battery_voltage();
66
67 if ((power_thread_inputs & POWER_INPUT_BATTERY) == 0) {
68 /* Just return a safe value if battery isn't connected */
69 return 4050;
70 }
71
72 return batt_millivolts;
73}
74
75