Commit graph

296 commits

Author SHA1 Message Date
Christian Soffke
7e0e4fe888 Add setting to hide shutdown message
Also keeps display from lighting up before shutdown,
which reduces distractions, especially at night and
when the sleep timer is used by allowing the
screen to remain dark.

Change-Id: I1c2d1966f6fb9766532adf01e8828876a871857f
2021-12-08 22:26:38 -05:00
William Wilgus
3e37013218 misc.c strip_extension() cleanup
optimize +
add some error checking of inputO

Change-Id: I88c476f5fa66847adc0b361df1a0dd4818dbfdc6
2021-08-17 08:28:23 -04:00
William Wilgus
d57900ae12 misc.c format_sound_value guard division by zero
Change-Id: I7085cb34d2258aa5fc7e04fc0e73d6f733810038
2021-08-05 11:00:47 +00:00
William Wilgus
29fa47d43d Open Plugin cache plugin entry when possible
leave plugin entries in ram and try not to save them unless necessary
doesn't use more space just a bit of careful ordering with the buffer

Change-Id: I1973e9ad4655c2544f596b37cee35601a0cffa94
2021-03-18 02:39:30 +00:00
William Wilgus
3237ae4a4f LCD core move buf ptr and address look up function viewport struct
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device

[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr

while remote lcds may compile (and work in the sim) its not been tested on targets

[FIXED] backdrops need work to be screen agnostic

[FIXED] screen statusbar is not being combined into the main viewport correctly yet

[FIXED] screen elements are displayed incorrectly  after switch to void*

[FIXED] core didn't restore proper viewport on splash etc.

[NEEDS TESTING] remote lcd garbled data

[FIXED] osd lib garbled screen on bmp_part

[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport

[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer

[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing

[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage

[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags

Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26 12:28:48 -04:00
Solomon Peachy
a96eb1a7f7 Fix warnings and errors introduced in b030bf5
Change-Id: I23966b6a79c0d2cbab2e01c649c1b991f460d8ad
2020-10-01 16:08:20 -04:00
William Wilgus
2df3a5b04c Headphone / lineout pause/resume #FS13237
Allow Lineout to behave like headphone port in regards to
plug/unplug pause/resume

Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
2020-09-18 00:22:52 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
Sylvain Saubier
1224919f3a Comment details, typos
Change-Id: I71a283b8e705ad8b9274858bc3cde19d25fc7253
2020-05-24 14:31:15 +02:00
Solomon Peachy
2d70fdcd8c Improved reliability of runtime accounting and speaking it.
Change-Id: I6f0fb907e0378487cec387a2cfd3a20b9a596c4e
2019-08-06 04:47:20 +02:00
Solomon Peachy
0a6cad736f FS#12353: For car adapter mode, make delay before resuming configurable
Original patch by Stanislav Chizhik
Udpated by Igor Poretsky & myself

Change-Id: I472d4852ac25885658245f077723e4c98b9ad9b8
2019-02-03 23:36:57 +01:00
Solomon Peachy
39b64f7d4d FS#10311 -- Add beep when navigating to beginning or end of list.
Originally by Stephane Doyon.
Updated by Alex Wallis, Igor Poretsky, and myself.

Change-Id: I996f18043bd3377d5aeaf65f4290250ea2a6832b
2019-01-31 15:25:35 +01:00
Solomon Peachy
d24edc605b Add HAVE_LINEOUT_DETECTION and associated logic
This allows targets to automatically switch audio settings when the
line out is plugged/unplugged.

Only hooked up on the xDuoo X3, but there are other potential users.

Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
2019-01-04 23:52:42 +01:00
William Wilgus
d258edbb4f Fix Auto Ranged Time Fix Red for Database
Change-Id: I8f4edc4ca84792f977ea673d2435e15f7e2da14e
2018-12-22 14:31:40 -06:00
William Wilgus
4a8f263a7d Fix Auto Ranged Time Fix Red for Checkwps
Change-Id: I36e37c7557d6eee07978046e549509ee628aba2e
2018-12-22 13:53:00 -06:00
William Wilgus
a06d9c85f7 Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)
Unifies time formatting in settings_list.c allows time format to
display as HH:MM:SS.MSS or any consecutive combination thereof
(hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss)
works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING'

Time is auto-ranged dependent on value

Adds talk_time_intervals to allow time values to be spoken similar to
display format:  x Hours, x Minutes, x Seconds, x Milliseconds

Table lookups merged or removed from recording, clip meter and lcd timeout
-String_Choice replaced with TABLE_SETTING or INT_SETTING for these
functions as well, cleaned-up cfg_vals that get saved to cfgfile

RTL Languages ARE supported

Negative values ARE supported

Backlight on/off are now Always and Never to share formatter with LCD
Timeout

Added flag to allow ranged units to be locked to a minimum index

Added flag to allow leading zero to be supressed from the largest unit

merged talk_time_unit() and talk_time_intervals()

optimized time_split()

optimized format_time_auto()

Backlight time-out list same as original

Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
2018-12-22 12:27:21 -06:00
Solomon Peachy
75f74814c0 Voice: Don't omit "shutting down" speech warning when battery dies.
(Taken from Igor Poretsky's tree)

Change-Id: I0fee8346e857eeaea5059360c0f35bd6a2e98b97
2018-12-15 12:02:21 -05:00
William Wilgus
62a5ed49cc Fix possible truncation misc.c->output_dyn_value + use Kibytes
output_dyn_value now requires the count for number of units

Binary scale now shows Kibibytes instead of kilobytes (g#1742)

Fixes output for negative values as well

Change-Id: I8aa896860e97d2453fa35069e2dfe1caac60109f
2018-12-09 22:54:55 -06:00
Michael Sevakis
838ff9c67d Add a 32 byte read buffer to read_line.
Do as with fdprintf and avoid filesystem calls for every single
byte. If it overreads, just put the excess back with lseek, which
does no I/O itself.

Change-Id: Ifd5d21b5dca7183346e44d365d3f7d45e8cc6438
2017-12-12 15:57:51 -05:00
Michael Sevakis
12bc24adbf aced667 forgot about those pesky __PCTOOL__ things.
It was so close to aced666.

Change-Id: I2b952a0704bb2d006db5e3ea4a929db3118cf390
2017-11-21 06:08:23 -05:00
Michael Sevakis
aced667f48 Undo hacks to meant to get around string formatting limitations
The new vuprintf makes unnecessary workarounds due to formatting
limitations. I checked grep output for whatever appeared to fit
but it's possible I missed some instances because they weren't
so obvious.

Also, this means sound settings can dynamically work with any
number of decimals rather than the current assumption of one or
two. Add an ipow() function to help and take advantage of dynamic
field width and precision. Consolidate string formatting of sound
settings.

Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8
2017-11-21 05:01:14 -05:00
Amaury Pouly
d7871914ac Fix dangerous casts
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h

Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
2017-02-04 17:24:47 +01:00
Amaury Pouly
1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
Mihail Zenkov
26beb30c15 Save bookmark and settings on shutdown at low battery level on players without HD
Change-Id: I9b9bbf0568de9a82107b0be3b42c3fdba0a0a27d
2016-04-04 11:07:04 +02:00
Mihail Zenkov
6228c8da18 Fix reset runtime
Change-Id: Ic1ba0c7c7883aae43100c67235dbc2db83056fe7
2016-04-04 11:05:43 +02:00
Michael Sevakis
7d1a47cf13 Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.

Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.

Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.

Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.

2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.

3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.

4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.

Key core changes:
1) Files and directories share core code and data structures.

2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).

3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.

4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".

5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.

6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).

Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:

1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).

2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.

3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.

4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.

5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.

Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.

2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.

3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).

4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).

5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).

Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.

To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.

2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.

Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-08-30 03:48:23 +02:00
Thomas Martitz
5877f7b5c0 open_utf8: Actually use the result of read/write.
This silences warnings on some compilers but is anyway a good idea.

Change-Id: Ib566ab59a5d1cb433da466f3ce0c32ff150eb52e
2014-06-29 12:25:01 +02:00
Michael Sevakis
31b7122867 Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality.
The implementation is global on both HWCODEC and SWCODEC.

Basically, if either the specified elapsed or offset are non-zero,
it indicates a mid-track resume.

To resume by time only, set elapsed to nonzero and offset to zero.
To resume by offset only, set offset to nonzero and elapsed to zero.

Which one the codec uses and which has priority is up to the codec;
however, using an elapsed time covers more cases:

* Codecs not able to use an offset such as VGM or other atomic
formats

* Starting playback at a nonzero elapsed time from a source that
contains no offset, such as a cuesheet

The change re-versions pretty much everything from tagcache to nvram.

Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38
Reviewed-on: http://gerrit.rockbox.org/516
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-10 04:12:30 +01:00
Thomas Martitz
4f5b13077e Fix Player
Change-Id: Ie489f91f78a9bdbded9b4ce09c74602dbca3934b
2014-01-15 22:56:39 +01:00
Thomas Martitz
5007bd64c3 Fix checkwps.
Change-Id: Ic10df965d55939b4d5ff5105f83a08a097877910
2014-01-15 22:40:18 +01:00
Thomas Martitz
2eb873cea6 skins: Update SBS when changing activities.
When changing activities (those that are indicated via %cs skin tag), the sbs
needs to be updated, so that the UI viewport can be applied before that
activity draws its UI.

Fixes FS#12804. I hope this commit doesn't have bad side effects.

Change-Id: If45654e356749f5f27991430dbd1da6f23e6f802
2014-01-15 18:57:46 +01:00
PurlingNayuki
f0bec023d9 Implement volume limiter feature
Add a "volume limit" parameter to the configuration file. The maximum
value of volume setting in sound menu will be limited to the same as
volume limit. Also each time when setvol() is excuted, Rockbox will
check if the global_settings.volume value larger than
global_settings.volume_limit. If larger, take the value of volume_limit
instead. The volume_limit argument shares the same maximum and minimum values
with volume argument, while taking the maximum volume as its default value.

Change-Id: I8ca9bc6ea6e617b48fc346aae5f2a0a1d259ae36
Reviewed-on: http://gerrit.rockbox.org/697
Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
2014-01-13 11:32:03 +01:00
Ralf Ertzinger
b170c73f92 Updated IAP commands.
Originally written and uploaded by Lalufu (Ralf Ertzinger) in Feb 2012.
They have been condensed into a single patch and some further additions
by Andy Potter.

Currently includes Authentication V2 support from iPod to Accessory,
RF/BlueTooth transmitter support, selecting a playlist and selecting a
track from the current playlist. Does not support uploading Album Art
or podcasts. Has been tested on the following iPods,
4th Gen Grayscale, 4th Gen Color/Photo, Mini 2nd Gen, Nano 1st Gen and
Video 5.5Gen.

Change-Id: Ie8fc098361844132f0228ecbe3c48da948726f5e
Co-Authored by: Andy Potter <liveboxandy@gmail.com>
Reviewed-on: http://gerrit.rockbox.org/533
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
2013-11-10 18:41:24 +01:00
Michael Sevakis
023f6b6efd Get rid of some superfluous single-purpose functions in playback.
* Remove explicit tracking of elapsed time of previous track.
* Remove function to obtain auto skip flag.
* Most playback events now carry the extra information instead and
  pass 'struct track_event *' for data.
* Tweak scrobbler to use PLAYBACK_EVENT_TRACK_FINISH, which makes
  it cleaner and removes the struct mp3entry.

Change-Id: I500d2abb4056a32646496efc3617406e36811ec5
2013-07-13 00:08:51 -04:00
Michael Sevakis
ffa8626b0c Fix whitespace in files for following commit.
Change-Id: I4adb8a152e9b99fcd26d95da7334d7d0cbe2a036
2013-07-12 21:39:06 -04:00
Thomas Martitz
8c655cfdc0 New GUI browser to select one (or more) folders.
The browser lets the user pick one or more directories in a convinient
GUI browser. The initial directory list is read from a string
(separated by colons) and the resulting list is written back to the same
string (again separated by colons).

Note: The work was initially done by Jonathan Gordon, however I changed
it substantially so I claim autorship.

This selector is going to be used for autoresume and database scan folders.

Change-Id: Id1d3186dad783411eb5c6056ce93f5b6123c7aa0
2012-07-30 21:20:51 +02:00
Jonathan Gordon
f6d6a4602c Fix fast_readline to handle windows line endings (\r\n)
Change-Id: I3561eff9bc4e244a84ef4afee26a40432d1073dd
2012-07-05 23:00:31 +10:00
Michael Sevakis
57a20d2d63 Make DSP's replaygain independent of global_settings.
Moves replaygain definitions to lib/rbcodec/dsp/dsp_misc.h.
Intermediate functions in misc.c handle any adjustment and calling
the rbcodec APIs.

Change-Id: I9f03561bca9aedd13760cf19c4e19aa3c68e7024
Reviewed-on: http://gerrit.rockbox.org/140
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-30 22:47:37 +02:00
Michael Sevakis
d18a5cad7f Tweak paramters of mp3_play_data and callback.
Use generic void * and size_t and make mp3_play_data and its callback
agree on types. Use mp3_play_callback_t instead of prototyping
right in the function call (so it's not so messy to look at). Change
doesn't appear to require plugin API version increment.

Change-Id: Idcab2740ee316a2beb6e0a87b8f4934d9d6b3dd8
2012-03-04 14:50:47 -05:00
Michael Sevakis
d05db0a90c Correct actionable offense for misappropriation of action context.
Just use a bool to indicate raw button instead of action code. No
bother with plugin version yet again so soon.

Change-Id: I4aa075c0c1fb5308c9d49bebb30ac76f671b2335
2012-03-03 07:52:13 -05:00
Michael Sevakis
f688710707 Change keyclick_click so that it may accept raw buttons or actions.
Adds a new context, CONTEXT_RAWBUTTON, that I hope is out of the way
of everything. Unfortunately have to increment min plugin API version
for the second time today to accomodate additional parameter.

Change-Id: Iaa46b926e57cf377fd4906f2d42bb98e87215033
2012-03-03 07:10:56 -05:00
Thomas Martitz
295c1c1e8b checkwps: Fix buildall.sh and some RaaA/ypr0 versions.
Change-Id: I5889743e94ed568c8f7dcc50de0b03b8421969f7
2012-02-10 20:27:59 +01:00
Jonathan Gordon
c2f0ba7ecd fix compiler error, missed action.h
Change-Id: Idc6d59835d1fd20cb4828543547b6d8b6f74053b
2012-01-15 00:56:56 +11:00
Jonathan Gordon
eb2ea7f9ad keyclick: Add a callback so screens can cancel a click. Add a generic list callback to stop clicks when we are at the end of the list
Change-Id: Iabb44a861dd7506cd883c1bdb0241303fa646746
2012-01-12 22:28:36 +11:00
Rafaël Carré
b612263b1e apps: lcd-remote.h is not needed if HAVE_REMOTE_LCD is not defined
Fix a comment

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31608 a1c6a512-1295-4272-9138-f99709370657
2012-01-07 19:35:46 +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
Nick Peskett
1b781df59c Convert hard-coded unicode byte order mark values to constants.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31374 a1c6a512-1295-4272-9138-f99709370657
2011-12-20 08:15:36 +00:00
Jonathan Gordon
f65ceebee8 Change the "keyclick repeat" setting behaviour so when it is off only the *first* repeat will click.
Otherwise single presses and all wheel movements will cause a click. with "keyclick repeat" enabled *all* repeats will cause clicks

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30997 a1c6a512-1295-4272-9138-f99709370657
2011-11-16 11:05:46 +00:00