forked from len0rd/rockbox
Set the default battery capacity for ipod video properly depending on detected RAM size.
Also set up a callback for the battery capacity setting (for all players) so changes take effect without having to reboot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30170 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
354d8fbc63
commit
aa27d47782
6 changed files with 52 additions and 8 deletions
|
|
@ -1188,6 +1188,7 @@ target/arm/ipod/power-ipod.c
|
|||
target/arm/ipod/powermgmt-ipod-pcf.c
|
||||
target/arm/ipod/video/lcd-as-video.S
|
||||
target/arm/ipod/video/lcd-video.c
|
||||
target/arm/ipod/video/battery-video.c
|
||||
target/arm/usb-fw-pp502x.c
|
||||
#endif /* SIMULATOR */
|
||||
#endif /* IPOD_VIDEO */
|
||||
|
|
|
|||
|
|
@ -136,8 +136,11 @@
|
|||
#define HAVE_HEADPHONE_DETECTION
|
||||
|
||||
/* Type of mobile power */
|
||||
#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the */
|
||||
/* 30GB model. 60/80GB would have 600 */
|
||||
#define BATTERY_CAPACITY_DEFAULT 400 /* only for variable initialisation */
|
||||
#define BATTERY_CAPACITY_DEFAULT_THIN 400 /* default battery capacity for the
|
||||
30GB model */
|
||||
#define BATTERY_CAPACITY_DEFAULT_THICK 600 /* default battery capacity for the
|
||||
60/80GB model */
|
||||
#define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
|
||||
#define BATTERY_CAPACITY_MAX 1400 /* max. capacity selectable */
|
||||
#define BATTERY_CAPACITY_INC 50 /* capacity increment */
|
||||
|
|
|
|||
33
firmware/target/arm/ipod/video/battery-video.c
Normal file
33
firmware/target/arm/ipod/video/battery-video.c
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id $
|
||||
*
|
||||
* Default battery capacity for ipod video
|
||||
*
|
||||
* Copyright (c) 2011 Frank Gevaerts
|
||||
*
|
||||
* 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 "system.h"
|
||||
|
||||
int battery_default_capacity(void)
|
||||
{
|
||||
if(probed_ramsize==64)
|
||||
return BATTERY_CAPACITY_DEFAULT_THICK;
|
||||
else
|
||||
return BATTERY_CAPACITY_DEFAULT_THIN;
|
||||
}
|
||||
|
|
@ -173,6 +173,7 @@ static inline void wake_core(int core)
|
|||
|
||||
#if defined(IPOD_VIDEO) && !defined(BOOTLOADER)
|
||||
extern unsigned char probed_ramsize;
|
||||
int battery_default_capacity(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue