summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
AgeCommit message (Collapse)Author
2010-02-14FS#10984 - multifont! 2 major additions:Jonathan Gordon
1) seperate UI font for the remote and main displays 2) allow individual skins to load additional fonts for use in the skin (Uo to 7 extra in this first version) see CustomWPS for info on how to load a font in the skins. Code should always use FONT_UI+screen_number to get the correct user font git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24644 a1c6a512-1295-4272-9138-f99709370657
2010-01-02Submit FS#10718. Small fix to calculation of estimated runtime to avoid ↵Andree Buschmann
negative results. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24146 a1c6a512-1295-4272-9138-f99709370657
2009-10-21Fix another bunch of iPod Nano 2G FTL bugs. It seems to work fine for me ↵Michael Sparmann
now, but this doesn't necessarily mean that it's bug-free. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23307 a1c6a512-1295-4272-9138-f99709370657
2009-10-09Core changes to allow storage drivers to do cleanup on shutdown, and iPod ↵Michael Sparmann
Nano 2G shutdown code rework (FS#10668) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23057 a1c6a512-1295-4272-9138-f99709370657
2009-07-26Re-work D2 power off behaviour.Rob Purchase
* Inhibit PCF timeout during shutdown and while charging * Power off the player using the same mechanism as the OF (GPIO) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22056 a1c6a512-1295-4272-9138-f99709370657
2009-05-07Jz4732: add hack to fix stack overflow in the power thread (fixes USB on ↵Maurus Cuelenaere
non-bootloader) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20867 a1c6a512-1295-4272-9138-f99709370657
2009-01-11c200v1/e200v1: Add battery charging. This should be usable on v2 players but ↵Michael Sevakis
those should be evaluated for current, endpoint voltage and whether or not accurate battery readings may always be obtained (which determines algorithm setup and behavior). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19748 a1c6a512-1295-4272-9138-f99709370657
2008-12-24Oops. Fix precompiler condition to be for all CONFIG_CHARGING != 0 (as it ↵Michael Sevakis
should be). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19581 a1c6a512-1295-4272-9138-f99709370657
2008-12-24Fix red and yellow.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19580 a1c6a512-1295-4272-9138-f99709370657
2008-12-24Simplify powermgmt thread loops so it calls functions turn (no more ↵Michael Sevakis
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
2008-12-21Fix red. Remove stale comment.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19548 a1c6a512-1295-4272-9138-f99709370657
2008-12-21Gigabeat S: Implement charging and power control to charge from AC or USB. ↵Michael Sevakis
Hold MENU while plugging USB cable to charge from USB without connecting. Under Windows, plugging USB for charging only but not connecting still needs to be properly handled (driver popup issue) but it will charge when connected normally-- no issue under Linux. Some accomodating changes made to powermgmt.c will soon be made nicer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19547 a1c6a512-1295-4272-9138-f99709370657
2008-12-09Color LCDs shouldn't have to have contrast set to 0 before shutdown. If ↵Michael Sevakis
contrast is implemented, then it can cause it to flash a bit before poweroff. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19369 a1c6a512-1295-4272-9138-f99709370657
2008-12-03Hopefully mop-up remaining red.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19317 a1c6a512-1295-4272-9138-f99709370657
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