]> sigrok.org Git - libsigrok.git/blobdiff - hwdriver.c
hwdriver: Change TRIGGER_SLOPE setting to string type.
[libsigrok.git] / hwdriver.c
index 55358ebf3953a86c7a6476dcb33041b940dd7a12..302ffdc5196eba6a19127cc6e7e5bda615942a2b 100644 (file)
@@ -62,7 +62,7 @@ static struct sr_config_info sr_config_info_data[] = {
                "Swap channel order", NULL},
        {SR_CONF_RLE, SR_T_BOOL, "rle",
                "Run Length Encoding", NULL},
-       {SR_CONF_TRIGGER_SLOPE, SR_T_UINT64, "triggerslope",
+       {SR_CONF_TRIGGER_SLOPE, SR_T_CHAR, "triggerslope",
                "Trigger slope", NULL},
        {SR_CONF_TRIGGER_SOURCE, SR_T_CHAR, "triggersource",
                "Trigger source", NULL},
@@ -633,6 +633,27 @@ SR_API int sr_config_set(const struct sr_dev_inst *sdi,
        return ret;
 }
 
+/**
+ * Apply configuration settings to the device hardware.
+ *
+ * @param sdi The device instance.
+ *
+ * @return SR_OK upon success or SR_ERR in case of error.
+ */
+SR_API int sr_config_commit(const struct sr_dev_inst *sdi)
+{
+       int ret;
+
+       if (!sdi || !sdi->driver)
+               ret = SR_ERR;
+       else if (!sdi->driver->config_commit)
+               ret = SR_OK;
+       else
+               ret = sdi->driver->config_commit(sdi);
+
+       return ret;
+}
+
 /**
  * List all possible values for a configuration key.
  *