X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fnorma-dmm%2Fprotocol.c;h=39924176d484c4ddab04f126a4d245c8dba888c0;hb=1de14d67f1b30a3fc32f9e715e2c0743ee74ca5c;hp=fcaae133b494e7e67a8c398cff2cd0db10aeac75;hpb=55bee166eb66ffc10409c6787a2fb6457a2fdaf8;p=libsigrok.git diff --git a/src/hardware/norma-dmm/protocol.c b/src/hardware/norma-dmm/protocol.c index fcaae133..39924176 100644 --- a/src/hardware/norma-dmm/protocol.c +++ b/src/hardware/norma-dmm/protocol.c @@ -17,11 +17,6 @@ * along with this program. If not, see . */ -/** @file - * Norma DM9x0/Siemens B102x DMMs driver. - * @internal - */ - #include #include "protocol.h" @@ -123,7 +118,8 @@ static void nma_process_line(const struct sr_dev_inst *sdi) /* Start decoding. */ value = 0.0; scale = 1.0; - sr_analog_init(&analog, &encoding, &meaning, &spec, 0); + /* TODO: Use proper 'digits' value for this device (and its modes). */ + sr_analog_init(&analog, &encoding, &meaning, &spec, 2); /* * The numbers are hex digits, starting from 0. @@ -349,13 +345,13 @@ static void nma_process_line(const struct sr_dev_inst *sdi) /* 4: Flags. Evaluating this after setting value! */ flags = xgittoint(devc->buf[4]); if (flags & 0x04) /* Invalid value */ - value = NAN; + value = NAN; else if (flags & 0x01) /* Overload */ - value = INFINITY; + value = INFINITY; if (flags & 0x02) { /* Duplicate value, has been sent before. */ - sr_spew("Duplicate value, dismissing!"); - devc->buflen = 0; - return; + sr_spew("Duplicate value, dismissing!"); + devc->buflen = 0; + return; } sr_spew("range=%d/scale=%f/value=%f", range, @@ -413,7 +409,7 @@ SR_PRIV int norma_dmm_receive_data(int fd, int revents, void *cb_data) } if (sr_sw_limits_check(&devc->limits)) { - sdi->driver->dev_acquisition_stop(sdi); + sr_dev_acquisition_stop(sdi); } else { /* Request next package. */ if (devc->last_req_pending) {