aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>2017-01-12 00:29:03 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2017-01-21 15:08:21 +0100
commitd8b65ef66112f2c5dccdbe668b05e6856c00ac3d (patch)
treeb4ac89a4741199027ddb257cd1fc4d5456830c25
parent5223412ebe3cadaab0e9b2a65e591b7cf575c404 (diff)
hameg_hmo: Mostly fix dumping of current timebase
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.
-rw-r--r--src/hardware/hameg-hmo/protocol.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c
index b251659..b0cdfe7 100644
--- a/src/hardware/hameg-hmo/protocol.c
+++ b/src/hardware/hameg-hmo/protocol.c
@@ -364,8 +364,9 @@ static void scope_state_dump(const struct scope_config *config,
state->digital_pods[i] ? "On" : "Off");
}
- tmp = sr_period_string((*config->timebases)[state->timebase][0] *
- (*config->timebases)[state->timebase][1]);
+ /* FIXME: this is wrong for TB > 1 second */
+ tmp = sr_period_string((*config->timebases)[state->timebase][1] /
+ (*config->timebases)[state->timebase][0]);
sr_info("Current timebase: %s", tmp);
g_free(tmp);