X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fmotech-lps-30x%2Fprotocol.c;h=4de6f0e9d4b5fb7546fa85a17c172ffd943b602a;hb=f9c6b5cfd3c0f6cb737f6a68f69034ce6819f36d;hp=80b799d9e9dd1c08cf0590fa055af97729b957b6;hpb=ddfe99d92f70a8a26cb3aa809e59c6a242897bd3;p=libsigrok.git diff --git a/src/hardware/motech-lps-30x/protocol.c b/src/hardware/motech-lps-30x/protocol.c index 80b799d9..4de6f0e9 100644 --- a/src/hardware/motech-lps-30x/protocol.c +++ b/src/hardware/motech-lps-30x/protocol.c @@ -18,9 +18,12 @@ * along with this program. If not, see . */ -/** @file - * Motech LPS-30x series power supply driver - * @internal +/** + * @file + * + * Motech LPS-30x series power supply driver + * + * @internal */ #include @@ -44,6 +47,7 @@ static void send_data(struct sr_dev_inst *sdi) packet.type = SR_DF_ANALOG; packet.payload = &analog; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); analog.meaning->channels = sdi->channels; @@ -51,6 +55,8 @@ static void send_data(struct sr_dev_inst *sdi) analog.meaning->mq = SR_MQ_VOLTAGE; analog.meaning->unit = SR_UNIT_VOLT; analog.meaning->mqflags = SR_MQFLAG_DC; + analog.encoding->digits = 3; + analog.spec->spec_digits = 2; analog.data = data; for (i = 0; i < devc->model->num_channels; i++) @@ -60,6 +66,8 @@ static void send_data(struct sr_dev_inst *sdi) analog.meaning->mq = SR_MQ_CURRENT; analog.meaning->unit = SR_UNIT_AMPERE; analog.meaning->mqflags = 0; + analog.encoding->digits = 4; + analog.spec->spec_digits = 3; analog.data = data; for (i = 0; i < devc->model->num_channels; i++) ((float *)analog.data)[i] = devc->channel_status[i].output_current_last; /* Value always 0 for channel 3, if present! */