]> sigrok.org Git - libsigrok.git/commitdiff
yokogawa-dlm: Mostly fix dumping of current timebase
authorStefan Brüns <redacted>
Sat, 14 Jan 2017 19:56:08 +0000 (20:56 +0100)
committerUwe Hermann <redacted>
Sat, 21 Jan 2017 14:08:21 +0000 (15:08 +0100)
sr_period_string takes the frequency as its argument, i.e. the reciprocal
of the timebase. Obviously this will not work for frequencies less than
1Hz / timebases greater than 1 second, but at least is correct for all
other available timebases.

src/hardware/yokogawa-dlm/protocol.c

index bd2f33f0913969342b449258b397fc18b3b074d2..08866898b093bf483ad273ba650458e822bd3c06 100644 (file)
@@ -305,8 +305,8 @@ static void scope_state_dump(const struct scope_config *config,
                                state->pod_states[i] ? "On" : "Off");
        }
 
-       tmp = sr_period_string(dlm_timebases[state->timebase][0] *
-                       dlm_timebases[state->timebase][1]);
+       tmp = sr_period_string(dlm_timebases[state->timebase][1] /
+                       dlm_timebases[state->timebase][0]);
        sr_info("Current timebase: %s", tmp);
        g_free(tmp);