X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fnorma-dmm%2Fprotocol.c;h=de31828a706bcdc1f96f5b7155347ee5526ae564;hb=ad466f86cc0497f6a5ba0e2540e399c32c0b96ba;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..de31828a 100644 --- a/src/hardware/norma-dmm/protocol.c +++ b/src/hardware/norma-dmm/protocol.c @@ -17,9 +17,12 @@ * along with this program. If not, see . */ -/** @file - * Norma DM9x0/Siemens B102x DMMs driver. - * @internal +/** + * @file + * + * Norma DM9x0/Siemens B102x DMMs driver. + * + * @internal */ #include @@ -123,7 +126,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 +353,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,