summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c')
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c
index 14c4926fde..d85ade18c3 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/powermgmt-creativezvm.c
@@ -1,59 +1,59 @@
1/*************************************************************************** 1/***************************************************************************
2 * __________ __ ___. 2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2007 by Karl Kurbjun 10 * Copyright (C) 2007 by Karl Kurbjun
11 * 11 *
12 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2 14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version. 15 * of the License, or (at your option) any later version.
16 * 16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "config.h" 22#include "config.h"
23#include "adc.h" 23#include "adc.h"
24#include "powermgmt.h" 24#include "powermgmt.h"
25#include "kernel.h" 25#include "kernel.h"
26 26
27/* THIS CONTAINS CURRENTLY DUMMY CODE! */ 27/* THIS CONTAINS CURRENTLY DUMMY CODE! */
28 28
29unsigned short current_voltage = 3910; 29unsigned short current_voltage = 3910;
30const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 30const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
31{ 31{
32 0 32 0
33}; 33};
34 34
35const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = 35const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
36{ 36{
37 0 37 0
38}; 38};
39 39
40/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 40/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
41const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = 41const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
42{ 42{
43 { 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320 }, 43 { 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320 },
44}; 44};
45 45
46/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ 46/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
47const unsigned short percent_to_volt_charge[11] = 47const unsigned short percent_to_volt_charge[11] =
48{ 48{
49 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320, 49 100, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1320,
50}; 50};
51void read_battery_inputs(void) 51void read_battery_inputs(void)
52{ 52{
53} 53}
54 54
55/* Returns battery voltage from ADC [millivolts] */ 55/* Returns battery voltage from ADC [millivolts] */
56unsigned int battery_adc_voltage(void) 56unsigned int battery_adc_voltage(void)
57{ 57{
58 return current_voltage; 58 return current_voltage;
59} 59}