]> sigrok.org Git - libsigrok.git/blobdiff - src/input/feed_queue.c
kingst-la2016: rework acquisition limits, improve CLI use
[libsigrok.git] / src / input / feed_queue.c
index 98443244a235281f9cb422ed800b8a067995e572..b25fa77affdc8b7f90731dafa62ed5ef6b6ab9ab 100644 (file)
@@ -22,7 +22,7 @@
 #include <string.h>
 
 struct feed_queue_logic {
-       struct sr_dev_inst *sdi;
+       const struct sr_dev_inst *sdi;
        size_t unit_size;
        size_t alloc_count;
        size_t fill_count;
@@ -31,7 +31,8 @@ struct feed_queue_logic {
        struct sr_datafeed_logic logic;
 };
 
-SR_API struct feed_queue_logic *feed_queue_logic_alloc(struct sr_dev_inst *sdi,
+SR_API struct feed_queue_logic *feed_queue_logic_alloc(
+       const struct sr_dev_inst *sdi,
        size_t sample_count, size_t unit_size)
 {
        struct feed_queue_logic *q;
@@ -94,6 +95,21 @@ SR_API int feed_queue_logic_flush(struct feed_queue_logic *q)
        return SR_OK;
 }
 
+SR_API int feed_queue_logic_send_trigger(struct feed_queue_logic *q)
+{
+       int ret;
+
+       ret = feed_queue_logic_flush(q);
+       if (ret != SR_OK)
+               return ret;
+
+       ret = std_session_send_df_trigger(q->sdi);
+       if (ret != SR_OK)
+               return ret;
+
+       return SR_OK;
+}
+
 SR_API void feed_queue_logic_free(struct feed_queue_logic *q)
 {
 
@@ -105,7 +121,7 @@ SR_API void feed_queue_logic_free(struct feed_queue_logic *q)
 }
 
 struct feed_queue_analog {
-       struct sr_dev_inst *sdi;
+       const struct sr_dev_inst *sdi;
        size_t alloc_count;
        size_t fill_count;
        float *data_values;
@@ -118,7 +134,8 @@ struct feed_queue_analog {
        GSList *channels;
 };
 
-SR_API struct feed_queue_analog *feed_queue_analog_alloc(struct sr_dev_inst *sdi,
+SR_API struct feed_queue_analog *feed_queue_analog_alloc(
+       const struct sr_dev_inst *sdi,
        size_t sample_count, int digits, struct sr_channel *ch)
 {
        struct feed_queue_analog *q;