Commit graph

26 commits

Author SHA1 Message Date
William Wilgus
97a82ee3ec plugins HAVE_BACKLIGHT helper remove ifdefs in favor of dummy functions
lessen the ifdef hell

Change-Id: I52f830284e4599f3fc3a75c27dda27058b8de1a3
2022-11-23 23:00:29 -05:00
Solomon Peachy
c522917644 plugins/resistor: Fix incorrect check for a valid 4th band value
Change-Id: I499bcd6d2d6fd5dd92c184cc1ec014e62f0441fa
2021-08-04 14:56:20 +00:00
Solomon Peachy
9be5bc4cf0 plugins: More HAVE_BACKLIGHT cleanup
Change-Id: I70cf700f5bc3d4375c025efa62ef40fd2bd70293
2020-07-24 19:20:15 -04:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
Thomas Martitz
1c5d0b41ee scroll_engine: Rename scroll_stop* functions to be more consistent with the lcd api.
Change-Id: I8ada10b96bfb628cca0331689e8b936ae47c7e1c
2013-12-14 23:11:30 +01:00
Boris Gjenero
8687c5cebb Fix FS#11675 : LED resistor calculator does not wait for keypress. Thanks to Michael Chicoine for reporting the bug.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31107 a1c6a512-1295-4272-9138-f99709370657
2011-12-02 01:58:07 +00:00
Thomas Jarosch
0d651ddc48 Remove now unneeded variable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30346 a1c6a512-1295-4272-9138-f99709370657
2011-08-25 19:24:16 +00:00
Thomas Jarosch
59b8c7816f Fix off-by-one memory corruption in resistor plugin.
I'm wondering if that also was the cause
for the lines exactly next to it:

---------------------------------
     /* This cleans out the mysterious garbage that appears */
     rb->lcd_clear_display();
---------------------------------
-> Atleast I see no garbage in the sim.

Credit for this bug goes to "cppcheck".

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30345 a1c6a512-1295-4272-9138-f99709370657
2011-08-25 19:18:20 +00:00
Andree Buschmann
9befc2e747 Remove tabs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29842 a1c6a512-1295-4272-9138-f99709370657
2011-05-08 21:21:02 +00:00
Andree Buschmann
0258895faa Fix error in Ohm's law formula as provided in FS#12023. Thanks to Leif Andersen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29644 a1c6a512-1295-4272-9138-f99709370657
2011-03-25 07:22:38 +00:00
Teruaki Kawashima
01313d5039 * Rename backlight_force_on to backlight_ignore_timeout to make it clear what the function does.
* Add backlight_force_on() which forces to turn on backlight even when the setting is set to Off. use this in lamp.
No functional change except lamp.
See aslo FS#9883.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29128 a1c6a512-1295-4272-9138-f99709370657
2011-01-24 12:29:16 +00:00
Frank Gevaerts
0d91797d96 Resistor calculator: make brace-style consistent
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28282 a1c6a512-1295-4272-9138-f99709370657
2010-10-14 20:13:05 +00:00
Michael Chicoine
529fb70694 Fix typo in resistor plugin help text
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28278 a1c6a512-1295-4272-9138-f99709370657
2010-10-14 03:42:13 +00:00
Frank Gevaerts
a43ace55ea Resistor calculator: Initialise variable to make the compiler shut up about it (it's always initialised, but the compiler won't know that)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28276 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 21:56:36 +00:00
Frank Gevaerts
7d6c73a1c1 Resistor calculator: Support Gigaohms in resistor to colour conversion, and guard against values that can not be represented
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28275 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 21:52:45 +00:00
Frank Gevaerts
ed869242e4 Resistor calculator: Use correct units if resistor to colour uses kilo- or megaohms
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28274 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 21:30:40 +00:00
Frank Gevaerts
580a5d8207 Add violet, grey and white multiplier for completeness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28273 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 21:12:21 +00:00
Frank Gevaerts
c00fe34a81 Fix some incorrect colour-to-resistance results. The price is that sometimes the display is subobtimal (like "2000 Ohms" instead of "2 KOhms")
Ideally, unit prefixes (K, M,...) should be calculated separately, but the largest resistance we can handle is 99 MOhm, which wouldn't fit in a 32 bit int (using our centiohm internal units) if we didn't cheat. (and technically we could go higher still. white-white-white would be 99 GOhm, but we don't do such high multipliers now)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28272 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 21:05:50 +00:00
Frank Gevaerts
771646a576 Resistor calculator: Add lots of static, and slightly reorganise the code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28271 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 20:43:18 +00:00
Frank Gevaerts
29503eea86 Simplify resistance to colour calculations, removing some bugs in the process.
Fixes the bugs that triggered FS#11667


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28269 a1c6a512-1295-4272-9138-f99709370657
2010-10-13 20:13:39 +00:00
Frank Gevaerts
ae75c6eb0a Resistor calculator: Don't assume a specific foreground colour
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28205 a1c6a512-1295-4272-9138-f99709370657
2010-10-03 14:52:20 +00:00
Frank Gevaerts
c80dd635ab Resistor calculator: simplify layout code, add scrolling, and handle error cases
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28203 a1c6a512-1295-4272-9138-f99709370657
2010-10-03 13:57:18 +00:00
Frank Gevaerts
9caca08ebc Fix typo properly this time, to ensure all green
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28195 a1c6a512-1295-4272-9138-f99709370657
2010-10-02 14:48:03 +00:00
Frank Gevaerts
e1320fd442 Fix typo, which should fix yellow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28194 a1c6a512-1295-4272-9138-f99709370657
2010-10-02 14:46:33 +00:00
Frank Gevaerts
09cb453f0b Resistor plugin:
crop the smallest bitmap so it's usable for any small screen and nut just the c200
   make the layout a bit more flexible


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28193 a1c6a512-1295-4272-9138-f99709370657
2010-10-02 14:43:23 +00:00
Frank Gevaerts
ad6c8c1a72 New plugin: Resistor code calculator
Flyspray: FS#11585
Author: Calvin Walden


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28191 a1c6a512-1295-4272-9138-f99709370657
2010-10-02 14:11:40 +00:00