From: Bert Vermeulen Date: Fri, 10 Jan 2014 01:09:49 +0000 (+0100) Subject: atten-pps3xxx: Use configured values to construct packet. X-Git-Tag: libsigrok-0.3.0~318 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=81c9e1a0647f3329eb61d2592e937051a17ecdd4;p=libsigrok.git atten-pps3xxx: Use configured values to construct packet. This used the values previously received from the device, not very useful. --- diff --git a/hardware/atten-pps3xxx/protocol.c b/hardware/atten-pps3xxx/protocol.c index d4ba6f9a..d1af4457 100644 --- a/hardware/atten-pps3xxx/protocol.c +++ b/hardware/atten-pps3xxx/protocol.c @@ -111,11 +111,11 @@ SR_PRIV void send_config(const struct sr_dev_inst *sdi) value = devc->config[i].output_current_max * 1000; packet[offset + 2] = (value >> 8) & 0xff; packet[offset + 3] = value & 0xff; - if (devc->config[i].output_enabled) + if (devc->config[i].output_enabled_set) packet[15] |= 1 << i; } - packet[18] = devc->over_current_protection ? 1 : 0; - packet[19] = devc->channel_mode; + packet[18] = devc->over_current_protection_set ? 1 : 0; + packet[19] = devc->channel_mode_set; /* Checksum. */ value = 0; for (i = 0; i < PACKET_SIZE - 1; i++)