]> sigrok.org Git - libsigrok.git/blobdiff - src/input/binary.c
input/trace32_ad: Drop unused #define.
[libsigrok.git] / src / input / binary.c
index 52e1da36e62c06d2a20202e27af957c22033381f..f0c798faed538aed5901d46223d7067cb338d073 100644 (file)
 
 #define LOG_PREFIX "input/binary"
 
-#define MAX_CHUNK_SIZE       4096
+#define MAX_CHUNK_SIZE       (4 * 1024 * 1024)
 #define DEFAULT_NUM_CHANNELS 8
 #define DEFAULT_SAMPLERATE   0
 
 struct context {
        gboolean started;
        uint64_t samplerate;
+       uint16_t unitsize;
 };
 
 static int init(struct sr_input *in, GHashTable *options)
@@ -60,6 +61,8 @@ static int init(struct sr_input *in, GHashTable *options)
                sr_channel_new(in->sdi, i, SR_CHANNEL_LOGIC, TRUE, name);
        }
 
+       inc->unitsize = (g_slist_length(in->sdi->channels) + 7) / 8;
+
        return SR_OK;
 }
 
@@ -92,7 +95,7 @@ static int process_buffer(struct sr_input *in)
 
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
-       logic.unitsize = (g_slist_length(in->sdi->channels) + 7) / 8;
+       logic.unitsize = inc->unitsize;
 
        /* Cut off at multiple of unitsize. */
        chunk_size = in->buf->len / logic.unitsize * logic.unitsize;