ch = sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "V");
cg->channels = g_slist_append(cg->channels, ch);
- ch = sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "I");
+ ch = sr_channel_new(sdi, 1, SR_CHANNEL_ANALOG, TRUE, "I");
cg->channels = g_slist_append(cg->channels, ch);
devc = g_malloc0(sizeof(struct dev_context));
*data = g_variant_new_boolean(devc->otp_active);
break;
case SR_CONF_UNDER_VOLTAGE_CONDITION:
- if (reloadpro_get_under_voltage_threshold(sdi, &fvalue) == SR_OK) {
- if (fvalue == .0)
- *data = g_variant_new_boolean(FALSE);
- else
- *data = g_variant_new_boolean(TRUE);
- }
+ if (reloadpro_get_under_voltage_threshold(sdi, &fvalue) == SR_OK)
+ *data = g_variant_new_boolean(fvalue != 0.0);
break;
case SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE:
*data = g_variant_new_boolean(devc->uvc_active);
return SR_ERR;
}
- serial_source_add(sdi->session, serial, G_IO_IN, 100,
- reloadpro_receive_data, (void *)sdi);
-
sr_sw_limits_acquisition_start(&devc->limits);
std_session_send_df_header(sdi);
memset(devc->buf, 0, RELOADPRO_BUFSIZE);
devc->buflen = 0;
+ g_mutex_init(&devc->acquisition_mutex);
+
+ serial_source_add(sdi->session, serial, G_IO_IN, 100,
+ reloadpro_receive_data, (void *)sdi);
+
return SR_OK;
}
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ int ret;
devc = sdi->priv;
devc->acquisition_running = FALSE;
- return std_serial_dev_acquisition_stop(sdi);
+ ret = std_serial_dev_acquisition_stop(sdi);
+ g_mutex_clear(&devc->acquisition_mutex);
+
+ return ret;
}
static struct sr_dev_driver arachnid_labs_re_load_pro_driver_info = {