From: Guido Trentalancia Date: Fri, 16 Nov 2018 20:51:49 +0000 (+0100) Subject: hameg-hmo: Use 1-based (not 0-based) POD numbers. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=262061ff3db5c4972e3351e4d93c5a0b4247f267;p=libsigrok.git hameg-hmo: Use 1-based (not 0-based) POD numbers. The current starting index for the POD name is currently wrong as it is zero. The official POD numbering starts instead at 1 (see device panel, buttons and manual), so the current index used for message printing and groups naming in the driver needs to be incremented by one. --- diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c index 9d0604f3..4341bdfc 100644 --- a/src/hardware/hameg-hmo/protocol.c +++ b/src/hardware/hameg-hmo/protocol.c @@ -404,11 +404,11 @@ static void scope_state_dump(const struct scope_config *config, for (i = 0; i < config->digital_pods; i++) { if (strncmp("USER", (*config->logic_threshold)[state->digital_pods[i].threshold], 4)) - sr_info("State of digital POD %d -> %s : %s (threshold)", i, + sr_info("State of digital POD %d -> %s : %s (threshold)", i + 1, state->digital_pods[i].state ? "On" : "Off", (*config->logic_threshold)[state->digital_pods[i].threshold]); else // user-defined or custom logic threshold - sr_info("State of digital POD %d -> %s : %E (threshold)", i, + sr_info("State of digital POD %d -> %s : %E (threshold)", i + 1, state->digital_pods[i].state ? "On" : "Off", state->digital_pods[i].user_threshold); } @@ -882,7 +882,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) ret = SR_ERR_MALLOC; break; } - devc->digital_groups[i]->name = g_strdup_printf("POD%d", i); + devc->digital_groups[i]->name = g_strdup_printf("POD%d", i + 1); sdi->channel_groups = g_slist_append(sdi->channel_groups, devc->digital_groups[i]); }