From abb39e6b8c9f2d512920dce440c0d8dd7a9a90f0 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Mon, 26 Aug 2013 23:42:09 +0200 Subject: [PATCH] ols: Properly initialize entire single-sample buffer before start The single sample buffer, up to 4 bytes long, was not getting initialized on (every) acquisition start, only after the first full sample was in. This caused the first sample to potentially hold garbage. --- hardware/openbench-logic-sniffer/api.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 87e43080..cb037908 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -503,6 +503,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, /* Reset all operational states. */ devc->num_transfers = devc->num_samples = devc->num_bytes = 0; + memset(devc->sample, 0, 4); /* Send header packet to the session bus. */ std_session_send_df_header(cb_data, LOG_PREFIX);