]> sigrok.org Git - libsigrok.git/commitdiff
ols: Properly initialize entire single-sample buffer before start
authorBert Vermeulen <redacted>
Mon, 26 Aug 2013 21:42:09 +0000 (23:42 +0200)
committerBert Vermeulen <redacted>
Mon, 26 Aug 2013 21:42:09 +0000 (23:42 +0200)
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

index 87e430806af78d60c96f461a2384978c0ee479a2..cb03790855c84c67e3656d9150bf698e288e9c30 100644 (file)
@@ -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);