]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Corrected RITCLEAR and suppress compiler warnings
authorc vw <dl1ycf@darc.de>
Fri, 28 May 2021 09:36:42 +0000 (11:36 +0200)
committerc vw <dl1ycf@darc.de>
Fri, 28 May 2021 09:36:42 +0000 (11:36 +0200)
midi3.c

diff --git a/midi3.c b/midi3.c
index eedf934cf9e1606f573fb09de74a1a633a38207b..5abf73f4e5b1ead15c5e4fefeb6c6482fde83e9c 100644 (file)
--- a/midi3.c
+++ b/midi3.c
@@ -444,6 +444,7 @@ int DoTheRestOfTheMIDI(void *data) {
         case MIDI_ACTION_DIV_COARSEPHASE:   // knob or wheel supported
         case MIDI_ACTION_DIV_FINEPHASE:     // knob or wheel supported
        case MIDI_ACTION_DIV_PHASE:             // knob or wheel supported
+            dnew=0.0;
             switch (type) {
               case MIDI_TYPE_KNOB:
                // coarse: change phase from -180 to 180
@@ -467,9 +468,7 @@ int DoTheRestOfTheMIDI(void *data) {
                }
                 break;
               default:
-                // do not change
-                // we should not come here anyway
-                dnew = 0.0;
+                // do nothing
                 break;
             }
             // dnew is the delta
@@ -834,7 +833,8 @@ int DoTheRestOfTheMIDI(void *data) {
        /////////////////////////////////////////////////////////// "RITCLEAR"
        case MIDI_ACTION_RIT_CLEAR:       // only key supported
            // clear RIT value
-           vfo[active_receiver->id].rit = new;
+           vfo[active_receiver->id].rit = 0;
+           vfo[active_receiver->id].rit_enabled = 0;
             vfo_update();
            break;
        /////////////////////////////////////////////////////////// "RITSTEP"