Commit graph

235 commits

Author SHA1 Message Date
Richard Quirk
71f70112b2 Add set_sleeptimer_duration function in minutes
Make set_sleep_timer a static function and only call
set_sleeptimer_duration externally, which is always called with minutes
values.

Change-Id: I985308bf014e354f91c47a0b2bf62f4f5a591919
Reviewed-on: http://gerrit.rockbox.org/327
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2012-10-06 11:59:13 +02:00
Amaury Pouly
a4fd5bf7cb imx233: enable charging in bootloader USB mode by including powermgmt
Change-Id: I8b91b3ab60cb9ffaa127333e9bcef8c33be742fa
2012-03-15 15:01:11 +01:00
Boris Gjenero
109084d5cb Fix FS#12555: Use smoothed battery voltage for level and runtime calculation
The debug screen gets un-smoothed battery status via battery_read_info().
The level and runtime that is normally presented to the user needs to be
based on smoothed voltage.

Change-Id: Icb448853973aa1d5832e9094176938cfa12b2e48
2012-01-21 12:10:31 -05:00
Rafaël Carré
12ef8723f8 lcd-remote-target.h: Use only in firmware/target/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31614 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 20:05:44 +00:00
Rafaël Carré
d0d00265cd powermgmt.c : include lcd-remote.h only when needed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31612 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 19:49:36 +00:00
Thomas Martitz
c1bd9b0361 Rework powermgmt to enable code re-use on appliation and sims.
* Introduce CONFIG_BATTERY_MEASURE define, to allow targets (application)
to break powermgmt.c's assumption about the ability to read battery voltage.
There's now additionally percentage (android) and remaining time measure
(maemo). No measure at all also works (sdl app). If voltage can't be measured,
then battery_level() is king and it'll be used for power_history and runtime
estimation.

* Implement target's API in the simulator, i.e. _battery_voltage(), so it
doesn't need to implement it's own powermgmt.c and other stubs. Now
the sim behaves much more like a native target, although it still
changes the simulated battery voltage quickly,

* Other changes include include renaming battery_adc_voltage() to
_battery_voltage(), for consistency with the new target functions and
making some of the apps code aware that voltage and runtime estimation
is not always available.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31548 a1c6a512-1295-4272-9138-f99709370657
2012-01-03 23:44:38 +00:00
Thomas Martitz
263b080b3b ypr0: Fix power off at low battery.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31520 a1c6a512-1295-4272-9138-f99709370657
2012-01-02 14:11:07 +00:00
Thomas Martitz
05f12e0877 ypr0: Enable battery voltage read-out, charging monitoring and charger detection.
Voltage can be read using as3543 adc (i.e. ascodec api, on this target implemented
via ioctl()). TODO: Look into possibly controlling charging more by re-using
powermgmt-ascodec.c. However, charging seems to be controlled by the kernel,
so may not be needed.

Charger state can be read using /dev/minivet. It allows to differentiate between
wall charger and usb charging, but that's not implemented (is it even worthwhile?)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31470 a1c6a512-1295-4272-9138-f99709370657
2011-12-31 13:34:56 +00:00
Nick Peskett
5dba771d63 Option to restart running sleep timer on keypress.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31437 a1c6a512-1295-4272-9138-f99709370657
2011-12-26 09:30:25 +00:00
Fred Bauer
100974162d FS:12299 Font glyph cache is no longer saved. Each font will now have its own glyph cache file with the extension '.gc' Includes a temporary fix that delays saving the file to prevent the creation of multiple gc files with same name. Mostly JD Gordon's code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30760 a1c6a512-1295-4272-9138-f99709370657
2011-10-16 13:18:46 +00:00
Thomas Jarosch
ff1f2e2415 Fix premature idle shutdown on RaaA after last track finished playing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29721 a1c6a512-1295-4272-9138-f99709370657
2011-04-16 16:57:35 +00:00
Thomas Jarosch
e303c80533 Don't compile handle_sleep_timer() code for the bootloader
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29556 a1c6a512-1295-4272-9138-f99709370657
2011-03-10 16:13:11 +00:00
Thomas Jarosch
98cf1a14b0 Don't call apps/ code from firmware/
Replace audio_stop() with audio_pause() in the sleep timer handler
for the connected charger case and remove recently added bookmarking code.

We don't power down anyway and a paused playback state
is still eligible for automatic bookmark creation if the
user later on removes the charger and waits for idle poweroff.

Hopefully other devs can sleep at night now. Or maybe I should leave
that change in there so they stay awake and hack on rockbox...

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29555 a1c6a512-1295-4272-9138-f99709370657
2011-03-10 15:50:15 +00:00
Thomas Jarosch
5c73e34d2d Bring idle poweroff to RaaA and the sim
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29543 a1c6a512-1295-4272-9138-f99709370657
2011-03-08 19:33:30 +00:00
Thomas Jarosch
2ebe370ca1 Move handle_auto_poweroff() down so RaaA can call it.
Add two ifdefs needed for APPLICATION builds

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29542 a1c6a512-1295-4272-9138-f99709370657
2011-03-08 19:33:25 +00:00
Thomas Jarosch
f96c254b76 Fix red in bootloader
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29508 a1c6a512-1295-4272-9138-f99709370657
2011-03-03 00:33:58 +00:00
Thomas Jarosch
84926583cf Fix bookmark creation on sleep timer. Fixes FS#11493
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29507 a1c6a512-1295-4272-9138-f99709370657
2011-03-03 00:25:03 +00:00
Thomas Jarosch
c9e00806d4 Fix red - 2nd try. Use same ifdef style as in firmware/drivers/pcf50606.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29487 a1c6a512-1295-4272-9138-f99709370657
2011-03-01 21:19:30 +00:00
Thomas Jarosch
ef99e33bc5 Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29486 a1c6a512-1295-4272-9138-f99709370657
2011-03-01 21:06:46 +00:00
Thomas Jarosch
acd8bffb95 Expose sys_poweroff() and cancel_shutdown() to RaaA. Hopefully fixes android build
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29485 a1c6a512-1295-4272-9138-f99709370657
2011-03-01 20:31:20 +00:00
Thomas Jarosch
3db9fd199f Fix red
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29468 a1c6a512-1295-4272-9138-f99709370657
2011-02-28 23:14:18 +00:00
Thomas Jarosch
2647d11354 Move sleep timer code outside of PLATFORM_NATIVE ifdef so RaaA can access it
Also remove redundant RaaA stubs for it.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29467 a1c6a512-1295-4272-9138-f99709370657
2011-02-28 23:05:00 +00:00
Andree Buschmann
322a51d437 Remove code that was unintentionally kept in a resynchronized patch in FS#3001. This closes FS#11873.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29119 a1c6a512-1295-4272-9138-f99709370657
2011-01-23 12:24:56 +00:00
Mustapha Senhaji
ccad6d0daf Few whitespace fixes by Michael Hohmuth FS#11885
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29082 a1c6a512-1295-4272-9138-f99709370657
2011-01-18 00:37:17 +00:00
Michael Chicoine
209020ceb1 Do not return negative sleeptimer values
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27774 a1c6a512-1295-4272-9138-f99709370657
2010-08-11 23:36:35 +00:00
Marcin Bukat
1ee19676f2 Add optional CURRENT_ATA in runcurrent(). On MPIO HD200 powering ata takes ~100mA which is sagnificant contribution to the total power consumption.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27589 a1c6a512-1295-4272-9138-f99709370657
2010-07-27 21:27:51 +00:00
Thomas Martitz
35e8b1429a Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with #if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently).
The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR).
The new define is to (de-)select code to compile on hosted platforms generally.

Should be no functional change to targets or the simulator.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-06-21 16:53:00 +00:00
Michael Sevakis
964dcb33b6 Revert r26055 since it breaks certain Archos targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26067 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 21:27:22 +00:00
Michael Sevakis
414dad42c5 If HAVE_POWEROFF_WHILE_CHARGING is not defined and the charging configuration specifies CHARGING_MONITOR or greater, allow poweroff while plugged but not actually charging the battery.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26055 a1c6a512-1295-4272-9138-f99709370657
2010-05-15 15:03:16 +00:00
Michael Giacomelli
589abcd416 Disable runtime estimation altogether when there is no runtime current defined. It doens't work and people somehow got confused by seeing obviously wrong values. Now it will just return -1 if you try to estimate runtime without having the current defined.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25222 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 17:13:25 +00:00
Michael Giacomelli
74bd14fa72 Remove some old archos code that caused runtime estimation to be off on AMS players while not actually working on Archos.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25220 a1c6a512-1295-4272-9138-f99709370657
2010-03-16 16:03:48 +00:00
Nils Wallménius
6c12fc20d9 Statically init array to 0 instead of runtime memset
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25085 a1c6a512-1295-4272-9138-f99709370657
2010-03-09 03:23:05 +00:00
Jonathan Gordon
1c2aa35371 FS#10984 - multifont! 2 major additions:
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-02-14 06:26:16 +00:00
Andree Buschmann
420b4e4be9 Submit FS#10718. Small fix to calculation of estimated runtime to avoid negative results.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24146 a1c6a512-1295-4272-9138-f99709370657
2010-01-02 20:24:25 +00:00
Michael Sparmann
0c89c0ef7c Fix another bunch of iPod Nano 2G FTL bugs. It seems to work fine for me 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-21 15:28:11 +00:00
Michael Sparmann
f0a96580ae Core changes to allow storage drivers to do cleanup on shutdown, and iPod Nano 2G shutdown code rework (FS#10668)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23057 a1c6a512-1295-4272-9138-f99709370657
2009-10-09 20:36:09 +00:00
Rob Purchase
c6309633a1 Re-work D2 power off behaviour.
* 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-07-26 19:41:24 +00:00
Maurus Cuelenaere
87978d4ee8 Jz4732: add hack to fix stack overflow in the power thread (fixes USB on non-bootloader)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20867 a1c6a512-1295-4272-9138-f99709370657
2009-05-07 14:05:42 +00:00
Michael Sevakis
7d7969114d c200v1/e200v1: Add battery charging. This should be usable on v2 players but 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
2009-01-11 10:07:22 +00:00
Michael Sevakis
9b8f56f35c Oops. Fix precompiler condition to be for all CONFIG_CHARGING != 0 (as it should be).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19581 a1c6a512-1295-4272-9138-f99709370657
2008-12-24 17:42:07 +00:00
Michael Sevakis
24e2d8671d Fix red and yellow.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19580 a1c6a512-1295-4272-9138-f99709370657
2008-12-24 17:28:01 +00:00
Michael Sevakis
3157e13956 Simplify powermgmt thread loops so it calls functions turn (no more 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-24 16:58:41 +00:00
Michael Sevakis
f6789a7d73 Fix red. Remove stale comment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19548 a1c6a512-1295-4272-9138-f99709370657
2008-12-21 18:27:59 +00:00
Michael Sevakis
5667682dd2 Gigabeat S: Implement charging and power control to charge from AC or USB. 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-21 18:10:36 +00:00
Michael Sevakis
4ae9de5490 Color LCDs shouldn't have to have contrast set to 0 before shutdown. If 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-09 01:33:01 +00:00
Michael Sevakis
bc963c34ae Hopefully mop-up remaining red.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19317 a1c6a512-1295-4272-9138-f99709370657
2008-12-03 21:15:44 +00:00
Michael Sevakis
58eb784a5d Straighten out some powermanagement stuff. Give target complete control over 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-12-03 19:54:25 +00:00
Frank Gevaerts
2f8a0081c6 Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do 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-11-01 16:14:28 +00:00
Frank Gevaerts
19d1cacb1a cleanup storage defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18950 a1c6a512-1295-4272-9138-f99709370657
2008-10-31 21:25:04 +00:00
Björn Stenberg
9558c4956d Moved pcm_record from firmware to apps. Cleaned up some. Now all code using struct mp3entry is in apps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18807 a1c6a512-1295-4272-9138-f99709370657
2008-10-14 11:12:20 +00:00