X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fcommon%2Fdmm%2Ffs9721.c;h=17a03a62647faf068dc577e91b2306b6fffd2868;hb=2451a20ff5137d178ed4a02ee04076c6eae97235;hp=41b08f713e7bb0bc133f3743c6f9f7be312bc2e0;hpb=50985c2019b2b5a6ce394589d89ee925b4f5e3a9;p=libsigrok.git diff --git a/hardware/common/dmm/fs9721.c b/hardware/common/dmm/fs9721.c index 41b08f71..17a03a62 100644 --- a/hardware/common/dmm/fs9721.c +++ b/hardware/common/dmm/fs9721.c @@ -326,11 +326,6 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, sr_spew("User-defined LCD symbol 3 is active."); } -SR_PRIV gboolean sr_fs9721_is_packet_start(uint8_t b) -{ - return (((b >> 4) & 0x0f) == 0x01); -} - SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf) { struct fs9721_info info; @@ -373,3 +368,61 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, return SR_OK; } + +SR_PRIV void sr_fs9721_00_temp_c(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_00' means temperature (C). */ + if (info_local->is_c2c1_00) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } +} + +SR_PRIV void sr_fs9721_01_temp_c(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (C). */ + if (info_local->is_c2c1_01) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } +} + +SR_PRIV void sr_fs9721_10_temp_c(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_10' means temperature (C). */ + if (info_local->is_c2c1_10) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } +} + +SR_PRIV void sr_fs9721_01_10_temp_f_c(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (F). */ + if (info_local->is_c2c1_01) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_FAHRENHEIT; + } + + /* User-defined FS9721_LP3 flag 'c2c1_10' means temperature (C). */ + if (info_local->is_c2c1_10) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } +}