summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_tokens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_tokens.c')
-rw-r--r--apps/gui/skin_engine/skin_tokens.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index efe67a186e..c2ee7bf426 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -478,6 +478,20 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
#ifdef HAVE_RADIO_RSSI
case SKIN_TOKEN_TUNER_RSSI:
snprintf(buf, buf_size, "%d",tuner_get(RADIO_RSSI));
+ if (intval)
+ {
+ int val = tuner_get(RADIO_RSSI);
+ int min = tuner_get(RADIO_RSSI_MIN);
+ int max = tuner_get(RADIO_RSSI_MAX);
+ if (limit == TOKEN_VALUE_ONLY)
+ {
+ *intval = val;
+ }
+ else
+ {
+ *intval = 1+(limit-1)*(val-min)/(max-1-min);
+ }
+ }
return buf;
case SKIN_TOKEN_TUNER_RSSI_MIN:
snprintf(buf, buf_size, "%d",tuner_get(RADIO_RSSI_MIN));