summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
AgeCommit message (Collapse)Author
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
2006-12-20fix typo, noticed by Steve GotthardtMarcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11822 a1c6a512-1295-4272-9138-f99709370657
2006-12-19Convert queues to use intptr_t for event data and return values as most of ↵Michael Sevakis
the time pointer are not passed and it should make some things a bit cleaner. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11818 a1c6a512-1295-4272-9138-f99709370657
2006-12-07Oops, that'll just keep resetting the timeout to 20s every time sys_poweroff ↵Michael Sevakis
is called and won't add the 8s recording margin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11686 a1c6a512-1295-4272-9138-f99709370657
2006-12-07SWCODEC Recording: 1) Fix minor bug of not subtracting line aligment ↵Michael Sevakis
adjustment from buffer size. 2) Handle stop and pause better and let pcmrec thread lock the DMA as that could cause prerecording to get disabled internally 3) Make sure to snapshot DMA write index to ensure compiler doesn't perform multiple access when calculating available data (probably just paranoia on my part) 4) Handle USB connect in recording thread a little better by resetting hardware to defaults after closing 5) Make power managment stop recording properly when powering off (ie. no yield() from interrupt handler! :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11685 a1c6a512-1295-4272-9138-f99709370657
2006-12-07Small delay before cutting off power to allow all hardware (especiallyMiika Pekkarinen
eeprom chip) to flush. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11682 a1c6a512-1295-4272-9138-f99709370657
2006-12-06Fix for FS#6328. Simulator battery level now goes down in roughly 1% ↵Dan Everton
increments roughly every second. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11673 a1c6a512-1295-4272-9138-f99709370657
2006-12-06first step in audio driver unification: renaming the functions to audio_*Marcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11670 a1c6a512-1295-4272-9138-f99709370657
2006-11-15Fix FS#6322. Battery level gets updated again as it should.Barry Wardell
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11534 a1c6a512-1295-4272-9138-f99709370657
2006-11-14Removed anachronisms introduced with low battery shutdown patch.Michael Sevakis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11524 a1c6a512-1295-4272-9138-f99709370657