From 0f1346b8aed999133702b4ed1114c09307dd45bc Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Sat, 22 Jan 2022 18:52:14 +0530
Subject: [PATCH] debug: s meter gain/attn toggle button

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

diff --git a/meter.c b/meter.c
index c9e54de..4bad5d7 100644
--- a/meter.c
+++ b/meter.c
@@ -192,9 +192,9 @@ if(analog_meter) {
   switch(meter_type) {
     case SMETER:
       {
-          double offset = with_gain ? 0 : adc[rx->adc].gain;
+          double offset = with_gain ? 0 : adc[rx->adc].attenuation;
           if(have_rx_gain) {
-              level = value + rx_gain_calibration - adc[rx->adc].attenuation - offset;
+              level = value + rx_gain_calibration - offset;
           } else {
               level=value + (double)adc[rx->adc].attenuation;
           }
-- 
2.45.2