gmc_mh_1x_2x: Fixed sign and AC/DC for current measurements with Metrahit <= 16.

This commit is contained in:
Matthias Heidbrink 2014-01-02 19:38:52 +01:00
parent 124c548de8
commit 1d4a283928
1 changed files with 3 additions and 3 deletions

View File

@ -102,17 +102,17 @@ static void decode_ctmv_16(uint8_t ctmv, struct dev_context *devc)
/** /**
* Decode range/sign/acdc byte special chars (Metrahit 12-16). * Decode range/sign/acdc byte special chars (Metrahit 12-16).
* *
* @param[in] spc Special characters 1 and 2 (s1 | (s2 << 4)). * @param[in] rs Range and sign byte.
*/ */
static void decode_rs_16(uint8_t rs, struct dev_context *devc) static void decode_rs_16(uint8_t rs, struct dev_context *devc)
{ {
sr_spew("decode_rs_16(%d) scale = %f", rs, devc->scale); sr_spew("decode_rs_16(%d) scale = %f", rs, devc->scale);
if (rs & 0x08) /* Sign */ if (rs & 0x04) /* Sign */
devc->scale *= -1.0; devc->scale *= -1.0;
if (devc->mq == SR_MQ_CURRENT) { if (devc->mq == SR_MQ_CURRENT) {
if (rs & 0x04) /* Current is AC */ if (rs & 0x08) /* Current is AC */
devc->mqflags |= SR_MQFLAG_AC; devc->mqflags |= SR_MQFLAG_AC;
else else
devc->mqflags |= SR_MQFLAG_DC; devc->mqflags |= SR_MQFLAG_DC;