From 92572cdd82ef8cce33eb52359f14ab0f2b13bd12 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Jan 1970 09:54:23 +0900 Subject: inc/dec burst count faster if encoder rotated faster --- menus.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/menus.c b/menus.c index c910210..9acdaeb 100644 --- a/menus.c +++ b/menus.c @@ -2323,11 +2323,23 @@ static void Submenu_Service_Encoder(int encoder_change) g_usleep (2e5); reset_encoder=YES; /* to avoid extra unwanted increments */ new_int_value=(int) (Submenu_Value); + +#define LARGE_CHANGE 3 +#define BURST_SMALL_INC 1 +#define BURST_LARGE_INC 10 if (encoder_change>0) { - ++new_int_value; - } else { - --new_int_value; + if (encoder_change>LARGE_CHANGE) { + new_int_value += BURST_LARGE_INC; + } else { + new_int_value += BURST_SMALL_INC; + } + } else if (encoder_change<0) { + if (encoder_change<-LARGE_CHANGE) { + new_int_value -= BURST_LARGE_INC; + } else { + new_int_value -= BURST_SMALL_INC; + } } if (new_int_value>globals.Constraints.err_max_burst_count[channel]) { -- cgit