From c7336628e042df5d1a6ee001b3b35d6fce6a2f0e Mon Sep 17 00:00:00 2001
From: DL1YCF <dl1ycf@darc.de>
Date: Sun, 19 Sep 2021 23:32:48 +0200
Subject: [PATCH] Implement "rounding" for ABSOLUTE changes

---
 actions.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/actions.c b/actions.c
index c4b7afc..613b2e0 100644
--- a/actions.c
+++ b/actions.c
@@ -211,6 +211,10 @@ static inline double KnobOrWheel(PROCESS_ACTION *a, double oldval, double minval
       break;
     case ABSOLUTE:
       oldval = minval + a->val*(maxval-minval)*0.01;
+      //
+      // Round the new value to a multiple of inc
+      //
+      oldval=inc*round(oldval/inc);
       break;
     default:
       // do nothing
@@ -842,8 +846,6 @@ int process_action(void *data) {
       break;
     case PANADAPTER_STEP:
       value=KnobOrWheel(a, active_receiver->panadapter_step, 5.0, 30.0, 1.0);
-      // restrict to multiples of 5
-      active_receiver->panadapter_step=(int)(value*0.2)+5;
       break;
     case PREAMP:
     case PS:
-- 
2.45.2