summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
AgeCommit message (Collapse)Author
2008-12-03Straighten out some powermanagement stuff. Give target complete control over ↵Michael Sevakis
how power inputs are sensed. Clean SIMULATOR stuff out of target files. Get rid of USB charging option on targets that don't support it or don't implement it yet. Menu string remains to avoid language incompatibility but should be removed on next cleanup for targets not using it (notice in english.lang). global_settings becomes incompatible for some builds and so plugin API version is incremented. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19315 a1c6a512-1295-4272-9138-f99709370657
2008-11-01Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do ↵Frank Gevaerts
that, it also introduces sd_*, nand_*, and mmc_*. This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
2008-10-31cleanup storage definesFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
2008-10-14Moved pcm_record from firmware to apps. Cleaned up some. Now all code using ↵Björn Stenberg
struct mp3entry is in apps. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18807 a1c6a512-1295-4272-9138-f99709370657
2008-10-12Bootloaders don't need special handling in sys_poweroff() for recording targets.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18780 a1c6a512-1295-4272-9138-f99709370657
2008-07-10fix the sleeptimer which got broken in r17872 Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18006 a1c6a512-1295-4272-9138-f99709370657
2008-06-29fix FS#8187 - charging breaks sleep timer. Now if the timer goes off and the ↵Jonathan Gordon
player is charging or connected to USB it will turn off the audio, but stay on git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17872 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-05-19Get a good start on cleaning up powermgmt.cMichael Sevakis
1) Consolidate charging types' code as much as possible at the moment. 2) Remove the iRiver code for the moment. It so happens that it isn't being compiled anyway so it's just noise. Grab it out of the revision history when needed again. 3) A small fix to CHARGING_CONTROL where changing of #defines somewhere in earlier revisions actually ended up having it use the wrong battery filter constant. A few state variables that were locals but stay in scope for the life of the power thread get static storage to help separate algorithms. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17580 a1c6a512-1295-4272-9138-f99709370657
2008-04-20fix red and remove tabsAndree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17196 a1c6a512-1295-4272-9138-f99709370657
2008-04-12FS#8871 by Tomasz Wasilczyk, avoid negative runtime estimation (that would ↵Nils Wallménius
later be cast to an unsigned giving huge values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17080 a1c6a512-1295-4272-9138-f99709370657
2008-03-11m:robe 100 - remove ugly workaround for false initial voltage readings and ↵Robert Kukla
wait until readings have settled instead git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16626 a1c6a512-1295-4272-9138-f99709370657
2007-11-30Delay reading the first battery level for at least 1 tick. Seems to fix the ↵Michael Sevakis
low battery shutdown problem on 3g. Reenable the low battery shutdown on 3g. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15857 a1c6a512-1295-4272-9138-f99709370657
2007-11-25Convert 2 more settings to table settings. * Fix duplicate value display if ↵Jens Arnold
the first value is selected in a table setting. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15805 a1c6a512-1295-4272-9138-f99709370657
2007-11-08No need to have this variable for targets that don't use itNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15534 a1c6a512-1295-4272-9138-f99709370657
2007-11-08Trigger an additional battery level announcement when the levelStéphane Doyon
reaches 5% (FS#8112). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15522 a1c6a512-1295-4272-9138-f99709370657
2007-11-03Little tidy-up on previous commit.Steve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15433 a1c6a512-1295-4272-9138-f99709370657
2007-11-03Fix recursion-stack overflow on simulator, also unify some variable names ↵Steve Bavin
and make battery level changes more realistic. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15432 a1c6a512-1295-4272-9138-f99709370657
2007-11-03Accept FS#7910: spontaneously speak out the battery level when it fallsStéphane Doyon
under 50%, 30% and 15%. Guarded by an option under voice settings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15422 a1c6a512-1295-4272-9138-f99709370657
2007-10-16Finally full multicore support for PortalPlayer 502x targets with an eye ↵Michael Sevakis
towards the possibility of other types. All SVN targets the low-lag code to speed up blocking operations. Most files are modified here simple due to a name change to actually support a real event object and a param change to create_thread. Add some use of new features but just sit on things for a bit and leave full integration for later. Work will continue on to address size on sensitive targets and simplify things if possible. Any PP target having problems with SWP can easily be changed to sw corelocks with one #define change in config.h though only PP5020 has shown an issue and seems to work without any difficulties. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15134 a1c6a512-1295-4272-9138-f99709370657
2007-09-29Fix the LCD line remaining active after shutdown on grayscale ipods ↵Nicolas Pennequin
(FS#5199). Original patch by Tomasz Mon, modified by me. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14907 a1c6a512-1295-4272-9138-f99709370657
2007-08-17First step of powermanagement rework: * Move target specific stuff into ↵Jens Arnold
target tree, starting with battery voltage tables and voltage reading. (This revealed some incorrect percent_to_voltage_charging mappings). * Voltage reading on 1st gen ipods is now correct. * Clean up obsolete config #defines. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14375 a1c6a512-1295-4272-9138-f99709370657
2007-08-16Fix signedness bug in trickle charge proportional adjustment which became ↵Jens Arnold
visible due to the changed calculation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14371 a1c6a512-1295-4272-9138-f99709370657
2007-08-15Switch to using millivolt for battery voltage and other internal voltages. * ↵Jens Arnold
Fix debug voltage history display. * Some code cleanup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14364 a1c6a512-1295-4272-9138-f99709370657
2007-08-14Don't let the shutdown code mess with the backlight anymore on most targets. ↵Jens Arnold
The backlight thread decides what to do on shutdown. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14340 a1c6a512-1295-4272-9138-f99709370657
2007-08-12Save a few bytes and make types more consistentNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14301 a1c6a512-1295-4272-9138-f99709370657
2007-08-12Enable a lot more features for simulators and add stubs where necessary, ↵Nils Wallménius
simulators should now work with identical lng and voice files as the respective target git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14299 a1c6a512-1295-4272-9138-f99709370657
2007-08-12Removed special X5 backlight handling, and replaced it with a generic system ↵Jens Arnold
that makes the backlight light up on shutdown and not time out unless it's completely disabled in the current player state. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14292 a1c6a512-1295-4272-9138-f99709370657
2007-07-14More battery updates, this time for gigabeat. FS #7433 from Johnathon MihalopPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13891 a1c6a512-1295-4272-9138-f99709370657
2007-07-14Correction for ipod video and nano battery type. FS #7216 by Andree BuschmannPeter D'Hoye
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13885 a1c6a512-1295-4272-9138-f99709370657
2007-07-08e200 lcd mashup: 1) Enable flipped and inverted mode. 2) Fully enable all ↵Michael Sevakis
power options so that LCD driver IC's visible display is shut down with backlight and make the Sleep option available 3) Better framebuffer copy routine in assembly that confines updates to the specified rectangle _and_ is faster than memcpy 4) Some other offhand changes out of preference. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13818 a1c6a512-1295-4272-9138-f99709370657
2007-06-29Shutdown and powermanagement cleanup: * Use the proper function for ↵Jens Arnold
determining whether the battery level is safe, and get rid of the extra one. Low battery warning now appears at 10% or less. * Don't delay shutdown artificially by 3 seconds due to low/critical battery warning. * Shutdown at critical battery level: Skip all disk-hitting housekeeping, make sure dircache stops, and don't mark disk as clean in eeprom. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13734 a1c6a512-1295-4272-9138-f99709370657
2007-05-03No more ear doctor visits after powering/unpowering the Gigabeat. Cleanup a ↵Michael Sevakis
little too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13312 a1c6a512-1295-4272-9138-f99709370657
2007-04-12Moved archos backlight code to target tree. Changed old mutlivalue ↵Jens Arnold
CONFIG_BACKLIGHT to a simple HAVE_BACKLIGHT. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13136 a1c6a512-1295-4272-9138-f99709370657
2007-04-05Calibrated (discharge) battery percentage table for iAudio X5(L) and M5(L). ↵Jens Arnold
Runcurrent values and hence runtime estimation is still off, but battery percentage should be ok now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13024 a1c6a512-1295-4272-9138-f99709370657
2007-03-23FS#6860 - Battery calibration for Sansa. Thanks to Matthias Wientapper.Barry Wardell
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12898 a1c6a512-1295-4272-9138-f99709370657
2007-03-16Rename some macros to account for the recently added M5 port. No code changes.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12809 a1c6a512-1295-4272-9138-f99709370657
2007-03-09Guess there were more changes to it.:) Odd that mine built until a make clean.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12694 a1c6a512-1295-4272-9138-f99709370657
2007-03-05Some more M5 adjustments.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12616 a1c6a512-1295-4272-9138-f99709370657
2007-03-04Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - ↵Daniel Ankers
iPod G3 will be coming soon.) This allows threads to be run on either core provided that all communications between the cores is done using uncached memory. There should be no significant change in battery life from doing this. Documentation (on the RockboxKernel wiki page) will follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12601 a1c6a512-1295-4272-9138-f99709370657
2007-02-28Add wake on alarm support for Ipods. Rename HAVE_ALARM_MOD to HAVE_ALARM_RTC ↵Thom Johansen
since it's not always a mod. Make Ipod PCF driver keep other flags in OOCC1 that have been set instead of overwriting them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12522 a1c6a512-1295-4272-9138-f99709370657
2007-02-18Fix CONFIG_BACKLIGHT warnings.Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12393 a1c6a512-1295-4272-9138-f99709370657
2007-02-18CONFIG_CHARGINGJonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12384 a1c6a512-1295-4272-9138-f99709370657
2007-02-18Explicilty set CONFIG_ defines to 0 which are not used.. because doing Jonathan Gordon
#if defined(BLAA) && BLAA == something defeats the point of Wundef git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12378 a1c6a512-1295-4272-9138-f99709370657
2007-02-01FS#4770 - Add USB charging for the H300 seriesSteve Bavin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12169 a1c6a512-1295-4272-9138-f99709370657
2007-01-28Do not change backlight timeout and disk spindown timeout when battery is lowNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12137 a1c6a512-1295-4272-9138-f99709370657
2007-01-23Permanently enable powering down the disk when it's sleeping for supported ↵Nils Wallménius
targets (iriver h1xx, h3xx and h10, iaudio x5, gigabeat and archos recorders) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12094 a1c6a512-1295-4272-9138-f99709370657
2007-01-14Update battery capacity and discharge tables to reflect current battery ↵Greg White
benchmarks git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12010 a1c6a512-1295-4272-9138-f99709370657
2007-01-08Hxxx battery voltage level for forced shutdown was little too low.Miika Pekkarinen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11948 a1c6a512-1295-4272-9138-f99709370657
2006-12-29merge a big part of the unofficial gigabeat cvs back. Includes working ↵Marcoen Hirschberg
bootloader and rockbox with audio. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11850 a1c6a512-1295-4272-9138-f99709370657