---
hardware/hameg-hmo/api.c | 8 +++++---
hardware/hameg-hmo/protocol.c | 4 ++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/hardware/hameg-hmo/api.c b/hardware/hameg-hmo/api.c
index bf3b868..0877d23 100644
--- a/hardware/hameg-hmo/api.c
+++ b/hardware/hameg-hmo/api.c
@@ -474,7 +474,7 @@ static int config_set(int key, GVariant *data, const struct
sr_dev_inst *sdi,
{
int ret, pg_type;
unsigned int i, j;
- char command[MAX_COMMAND_SIZE];
+ char command[MAX_COMMAND_SIZE], float_str[30];
struct dev_context *devc;
struct scope_config *model;
struct scope_state *state;
@@ -528,9 +528,10 @@ static int config_set(int key, GVariant *data, const
struct sr_dev_inst *sdi,
if (probe_group != &devc->analog_groups[j - 1])
continue;
state->analog_channels[j - 1].vdiv = (float) p
/ q;
+ g_ascii_formatd(float_str, sizeof(float_str),
"%E", (float) p / q);
g_snprintf(command, sizeof(command),
(*model->scpi_dialect)[SCPI_CMD_SET_VERTICAL_DIV],
- j, state->analog_channels[j-1].vdiv);
+ j, float_str);
if (sr_scpi_send(sdi->conn, command) != SR_OK ||
sr_scpi_get_opc(sdi->conn) != SR_OK)
@@ -551,9 +552,10 @@ static int config_set(int key, GVariant *data, const
struct sr_dev_inst *sdi,
q != (*model->timebases)[i][1])
continue;
state->timebase = (float) p / q;
+ g_ascii_formatd(float_str, sizeof(float_str), "%E",
(float) p / q);
g_snprintf(command, sizeof(command),
(*model->scpi_dialect)[SCPI_CMD_SET_TIMEBASE],
- state->timebase);
+ float_str);
ret = sr_scpi_send(sdi->conn, command);
break;
diff --git a/hardware/hameg-hmo/protocol.c b/hardware/hameg-hmo/protocol.c
index 9d5e177..2f7f5ab 100644
--- a/hardware/hameg-hmo/protocol.c
+++ b/hardware/hameg-hmo/protocol.c
@@ -22,12 +22,12 @@
static const char *hameg_scpi_dialect[] = {
[SCPI_CMD_GET_DIG_DATA] = ":POD%d:DATA?",
[SCPI_CMD_GET_TIMEBASE] = ":TIM:SCAL?",
- [SCPI_CMD_SET_TIMEBASE] = ":TIM:SCAL %E",
+ [SCPI_CMD_SET_TIMEBASE] = ":TIM:SCAL %s",
[SCPI_CMD_GET_COUPLING] = ":CHAN%d:COUP?",
[SCPI_CMD_SET_COUPLING] = ":CHAN%d:COUP %s",
[SCPI_CMD_GET_ANALOG_DATA] = ":CHAN%d:DATA?",
[SCPI_CMD_GET_VERTICAL_DIV] = ":CHAN%d:SCAL?",
- [SCPI_CMD_SET_VERTICAL_DIV] = ":CHAN%d:SCAL %E",
+ [SCPI_CMD_SET_VERTICAL_DIV] = ":CHAN%d:SCAL %s",
[SCPI_CMD_GET_DIG_POD_STATE] = ":POD%d:STAT?",
[SCPI_CMD_SET_DIG_POD_STATE] = ":POD%d:STAT %d",
[SCPI_CMD_GET_TRIGGER_SLOPE] = ":TRIG:A:EDGE:SLOP?",
--
1.8.5.3
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel