Index: firmware/export/config-e200v2.h =================================================================== --- firmware/export/config-e200v2.h (revision 20216) +++ firmware/export/config-e200v2.h (working copy) @@ -129,14 +129,14 @@ /* define this if the flash memory uses the SecureDigital Memory Card protocol */ #define CONFIG_STORAGE STORAGE_SD -#define BATTERY_CAPACITY_DEFAULT 750 /* default battery capacity */ -#define BATTERY_CAPACITY_MIN 750 /* min. capacity selectable */ -#define BATTERY_CAPACITY_MAX 750 /* max. capacity selectable */ +#define BATTERY_CAPACITY_DEFAULT 730 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 730 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 730 /* max. capacity selectable */ #define BATTERY_CAPACITY_INC 0 /* capacity increment */ #define BATTERY_TYPES_COUNT 1 /* only one type */ -/* Hardware controlled charging? FIXME */ -#define CONFIG_CHARGING CHARGING_SIMPLE +/* Charging implemented in a target-specific algorithm */ +#define CONFIG_CHARGING CHARGING_TARGET /* define this if the unit can be powered or charged via USB */ #define HAVE_USB_POWER Index: firmware/SOURCES =================================================================== --- firmware/SOURCES (revision 20216) +++ firmware/SOURCES (working copy) @@ -1110,7 +1110,8 @@ target/arm/as3525/sansa-e200v2/button-e200v2.c target/arm/as3525/backlight-e200v2-fuze.c #ifndef BOOTLOADER -target/arm/as3525/powermgmt-as3525.c +target/arm/powermgmt-ascodec.c +target/arm/as3525/sansa-e200v2/powermgmt-e200v2.c #endif /* !BOOTLOADER */ #endif /* !SIMULATOR */ #endif /* SANSA_E200V2 */ Index: firmware/target/arm/as3525/sansa-e200v2/powermgmt-e200v2.c =================================================================== --- firmware/target/arm/as3525/sansa-e200v2/powermgmt-e200v2.c (revision 0) +++ firmware/target/arm/as3525/sansa-e200v2/powermgmt-e200v2.c (revision 0) @@ -0,0 +1,49 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese + * Revisions copyright (C) 2005 by Gerald Van Baren + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "adc.h" +#include "powermgmt.h" + +const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = +{ + 3400 +}; + +const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = +{ + 3300 +}; + +/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ +const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = +{ + /* Sansa Li Ion 750mAH, took from battery benchs */ + { 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 }, +}; + +/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ +const unsigned short percent_to_volt_charge[11] = +{ + /* Sansa Li Ion 750mAH FIXME */ + 3300, 3680, 3740, 3760, 3780, 3810, 3870, 3930, 3970, 4070, 4160 +}; Property changes on: firmware/target/arm/as3525/sansa-e200v2/powermgmt-e200v2.c ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision" Added: svn:eol-style + native Index: firmware/target/arm/as3525/sansa-clip/powermgmt-target.h =================================================================== --- firmware/target/arm/as3525/sansa-clip/powermgmt-target.h (revision 20216) +++ firmware/target/arm/as3525/sansa-clip/powermgmt-target.h (working copy) @@ -1,42 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sevakis - * Copyright (C) 2008 by Bertrik Sikken - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef POWERMGMT_TARGET_H -#define POWERMGMT_TARGET_H - -/* Check if topped-off and monitor voltage while plugged. */ -#define BATT_FULL_VOLTAGE 4160 -#define BATT_VAUTO_RECHARGE 4100 -#define BATT_CHG_V CHG_V_4_20V -#define BATT_CHG_I CHG_I_100MA -#define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */ -#define ADC_BATTERY ADC_BVDD - -void powermgmt_init_target(void); -void charging_algorithm_step(void); -void charging_algorithm_close(void); - -/* We want to be able to reset the averaging filter */ -#define HAVE_RESET_BATTERY_FILTER - -#define BATT_AVE_SAMPLES 32 - -#endif /* POWERMGMT_TARGET_H */ Index: firmware/target/arm/as3525/powermgmt-target.h =================================================================== --- firmware/target/arm/as3525/powermgmt-target.h (revision 20216) +++ firmware/target/arm/as3525/powermgmt-target.h (working copy) @@ -22,6 +22,8 @@ #ifndef POWERMGMT_TARGET_H #define POWERMGMT_TARGET_H +#if defined(SANSA_CLIP) + /* Check if topped-off and monitor voltage while plugged. */ #define BATT_FULL_VOLTAGE 4160 #define BATT_VAUTO_RECHARGE 4100 @@ -30,6 +32,20 @@ #define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */ #define ADC_BATTERY ADC_BVDD +#elif defined(SANSA_E200V2) + +/* Check if topped-off and monitor voltage while plugged. */ +#define BATT_FULL_VOLTAGE 4160 +#define BATT_VAUTO_RECHARGE 4100 +#define BATT_CHG_V CHG_V_4_20V +#define BATT_CHG_I CHG_I_300MA +#define CHARGER_TOTAL_TIMER (4*3600*2) +#define ADC_BATTERY ADC_BVDD + +#else +#error "Charger settings not defined!" +#endif + void powermgmt_init_target(void); void charging_algorithm_step(void); void charging_algorithm_close(void); Property changes on: firmware/target/arm/as3525/powermgmt-target.h ___________________________________________________________________ Added: svn:mergeinfo