X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Farachnid-labs-re-load-pro%2Fprotocol.c;h=998ba17119113956bd1f3f17a57f9cb19223f0ad;hb=f6ce25ec05e8707ee3783b111ea13779f237c3b3;hp=9c080646c29fdca36236ca22136742cb20e40dad;hpb=b3e715e528aa41e14100e3b5aae73248a34ab335;p=libsigrok.git diff --git a/src/hardware/arachnid-labs-re-load-pro/protocol.c b/src/hardware/arachnid-labs-re-load-pro/protocol.c index 9c080646..998ba171 100644 --- a/src/hardware/arachnid-labs-re-load-pro/protocol.c +++ b/src/hardware/arachnid-labs-re-load-pro/protocol.c @@ -171,7 +171,7 @@ SR_PRIV int reloadpro_get_current_limit(const struct sr_dev_inst *sdi, end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND; if (!g_cond_wait_until(&devc->current_limit_cond, &devc->acquisition_mutex, end_time)) { - // timeout has passed. + /* Timeout has passed. */ g_mutex_unlock(&devc->acquisition_mutex); return SR_ERR; } @@ -207,7 +207,7 @@ SR_PRIV int reloadpro_get_under_voltage_threshold(const struct sr_dev_inst *sdi, end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND; if (!g_cond_wait_until(&devc->uvc_threshold_cond, &devc->acquisition_mutex, end_time)) { - // timeout has passed. + /* Timeout has passed. */ g_mutex_unlock(&devc->acquisition_mutex); return SR_ERR; } @@ -244,7 +244,7 @@ SR_PRIV int reloadpro_get_voltage_current(const struct sr_dev_inst *sdi, end_time = g_get_monotonic_time () + 5 * G_TIME_SPAN_SECOND; if (!g_cond_wait_until(&devc->voltage_cond, &devc->acquisition_mutex, end_time)) { - // timeout has passed. + /* Timeout has passed. */ g_mutex_unlock(&devc->acquisition_mutex); return SR_ERR; } @@ -380,6 +380,7 @@ static void handle_packet(const struct sr_dev_inst *sdi) meaning.mq = SR_MQ_VOLTAGE; meaning.mqflags = SR_MQFLAG_DC; meaning.unit = SR_UNIT_VOLT; + encoding.digits = 3; analog.data = &devc->voltage; sr_session_send(sdi, &packet); g_slist_free(l); @@ -391,6 +392,7 @@ static void handle_packet(const struct sr_dev_inst *sdi) meaning.mq = SR_MQ_CURRENT; meaning.mqflags = SR_MQFLAG_DC; meaning.unit = SR_UNIT_AMPERE; + encoding.digits = 3; analog.data = &devc->current; sr_session_send(sdi, &packet); g_slist_free(l);