gwinstek-gpd: Fix voltage/current measurement
This commit is contained in:
parent
c93c014f47
commit
1145ceaa78
|
@ -131,8 +131,8 @@ SR_PRIV int gpd_receive_data(int fd, int revents, void *cb_data)
|
||||||
|
|
||||||
reply[0] = '\0';
|
reply[0] = '\0';
|
||||||
gpd_receive_reply(serial, reply, sizeof(reply));
|
gpd_receive_reply(serial, reply, sizeof(reply));
|
||||||
if (sscanf(reply, "%f", &devc->config[i].output_voltage_max) != 1) {
|
if (sscanf(reply, "%f", &devc->config[i].output_current_last) != 1) {
|
||||||
sr_err("Invalid reply to VOUT1?: '%s'.",
|
sr_err("Invalid reply to IOUT1?: '%s'.",
|
||||||
reply);
|
reply);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -148,12 +148,12 @@ SR_PRIV int gpd_receive_data(int fd, int revents, void *cb_data)
|
||||||
analog.meaning->mqflags = 0;
|
analog.meaning->mqflags = 0;
|
||||||
analog.encoding->digits = 3;
|
analog.encoding->digits = 3;
|
||||||
analog.spec->spec_digits = 3;
|
analog.spec->spec_digits = 3;
|
||||||
analog.data = &devc->config[i].output_current_max;
|
analog.data = &devc->config[i].output_current_last;
|
||||||
sr_session_send(sdi, &packet);
|
sr_session_send(sdi, &packet);
|
||||||
|
|
||||||
reply[0] = '\0';
|
reply[0] = '\0';
|
||||||
gpd_receive_reply(serial, reply, sizeof(reply));
|
gpd_receive_reply(serial, reply, sizeof(reply));
|
||||||
if (sscanf(reply, "%f", &devc->config[i].output_voltage_max) != 1) {
|
if (sscanf(reply, "%f", &devc->config[i].output_voltage_last) != 1) {
|
||||||
sr_err("Invalid reply to VOUT1?: '%s'.",
|
sr_err("Invalid reply to VOUT1?: '%s'.",
|
||||||
reply);
|
reply);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -170,7 +170,7 @@ SR_PRIV int gpd_receive_data(int fd, int revents, void *cb_data)
|
||||||
analog.meaning->mqflags = SR_MQFLAG_DC;
|
analog.meaning->mqflags = SR_MQFLAG_DC;
|
||||||
analog.encoding->digits = 3;
|
analog.encoding->digits = 3;
|
||||||
analog.spec->spec_digits = 3;
|
analog.spec->spec_digits = 3;
|
||||||
analog.data = &devc->config[i].output_voltage_max;
|
analog.data = &devc->config[i].output_voltage_last;
|
||||||
sr_session_send(sdi, &packet);
|
sr_session_send(sdi, &packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue