From: Stefan BrĂ¼ns Date: Wed, 11 Jan 2017 23:29:03 +0000 (+0100) Subject: hameg_hmo: Mostly fix dumping of current timebase X-Git-Tag: libsigrok-0.5.0~137 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=d8b65ef66112f2c5dccdbe668b05e6856c00ac3d;hp=5223412ebe3cadaab0e9b2a65e591b7cf575c404;p=libsigrok.git 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. --- diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index b2516595..b0cdfe77 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);