summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/gwps-common.c2
-rw-r--r--apps/gui/wps_debug.c5
-rw-r--r--apps/gui/wps_parser.c12
3 files changed, 16 insertions, 3 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 806ce19d71..a81b8555f7 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1389,8 +1389,6 @@ static const char *get_token_value(struct gui_wps *gwps,
1389 return NULL; 1389 return NULL;
1390#endif 1390#endif
1391 case WPS_TOKEN_BUTTON_VOLUME: 1391 case WPS_TOKEN_BUTTON_VOLUME:
1392 if (token->value.i == 0)
1393 token->value.i = HZ;
1394 if (data->button_time_volume && 1392 if (data->button_time_volume &&
1395 TIME_BEFORE(current_tick, data->button_time_volume + 1393 TIME_BEFORE(current_tick, data->button_time_volume +
1396 token->value.i)) 1394 token->value.i))
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c
index f843b989a2..5a18218a52 100644
--- a/apps/gui/wps_debug.c
+++ b/apps/gui/wps_debug.c
@@ -431,7 +431,10 @@ static char *get_token_desc(struct wps_token *token, struct wps_data *data,
431 snprintf(buf, bufsize, "enable VP:%d", 431 snprintf(buf, bufsize, "enable VP:%d",
432 token->value.i); 432 token->value.i);
433 break; 433 break;
434 434 case WPS_TOKEN_BUTTON_VOLUME:
435 snprintf(buf, bufsize, "Volume button timeout:%d",
436 token->value.i);
437 break;
435 default: 438 default:
436 snprintf(buf, bufsize, "FIXME (code: %d)", 439 snprintf(buf, bufsize, "FIXME (code: %d)",
437 token->type); 440 token->type);
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 96e8d6664c..fc207efb9b 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -802,6 +802,18 @@ static int parse_timeout(const char *wps_bufptr,
802 if (have_tenth == false) 802 if (have_tenth == false)
803 val *= 10; 803 val *= 10;
804 804
805 if (val == 0 && skip == 0)
806 {
807 /* decide what to do if no value was specified */
808 switch (token->type)
809 {
810 case WPS_TOKEN_SUBLINE_TIMEOUT:
811 return -1;
812 case WPS_TOKEN_BUTTON_VOLUME:
813 val = HZ;
814 break;
815 }
816 }
805 token->value.i = val; 817 token->value.i = val;
806 818
807 return skip; 819 return skip;