summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-11-18 11:47:42 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-11-18 11:47:42 +0000
commit1ce7ba4931c64a7ae6a95981e838db97d7e05699 (patch)
tree0bb3de85e23bb64951f3acbd176a20301f7efb30 /uisimulator
parent62b8efe6741b61ef10d3c7b98dd0d3416b7fce11 (diff)
downloadrockbox-1ce7ba4931c64a7ae6a95981e838db97d7e05699.tar.gz
rockbox-1ce7ba4931c64a7ae6a95981e838db97d7e05699.tar.bz2
rockbox-1ce7ba4931c64a7ae6a95981e838db97d7e05699.zip
Make the %tr (radio RSSI) tag work as a bar tag or as a conditional.
As a conditional it scales its value to the number of options you give it (like volume) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28613 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/fmradio.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/uisimulator/common/fmradio.c b/uisimulator/common/fmradio.c
index cef9abf94e..6f6b0f914f 100644
--- a/uisimulator/common/fmradio.c
+++ b/uisimulator/common/fmradio.c
@@ -67,6 +67,9 @@ int tuner_set(int setting, int value)
int tuner_get(int setting)
{
int val = 0;
+#ifdef HAVE_RADIO_RSSI
+ static int rssi = 0, rssidiff = 2;
+#endif
switch(setting)
{
@@ -83,6 +86,29 @@ int tuner_get(int setting)
if(frequency == 99500000)
val = mono?0:1;
break;
+
+#ifdef HAVE_RADIO_RSSI
+ case RADIO_RSSI_MIN:
+ val = 5;
+ break;
+ case RADIO_RSSI_MAX:
+ val = 75;
+ break;
+ case RADIO_RSSI:
+ rssi += rssidiff;
+ if (rssi >= 75)
+ {
+ rssi = 75;
+ rssidiff = -2;
+ }
+ else if (rssi < 5)
+ {
+ rssi = 5;
+ rssidiff = 2;
+ }
+ val = rssi;
+ break;
+#endif
case RADIO_ALL: /* debug query */
break;