X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Ftext%2Fbits.c;h=af3196925281977a03d734a90e699ecbbffd851e;hb=ba7dd8bbb8168cba432a844259a3e239aa5f36d7;hp=ff149650fe9c540789db9a0b5d6c87ef8ddbfadb;hpb=91aea754aaed0f0f2a6fc4b2b875f0d0b7c01f8e;p=libsigrok.git diff --git a/output/text/bits.c b/output/text/bits.c index ff149650..af319692 100644 --- a/output/text/bits.c +++ b/output/text/bits.c @@ -50,7 +50,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in, * extra output, e.g. trigger. */ outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line) - * (ctx->num_enabled_probes * max_linelen); + * (ctx->num_enabled_channels * max_linelen); if (!(outbuf = g_try_malloc0(outsize + 1))) { sr_err("%s: outbuf malloc failed", __func__); @@ -69,7 +69,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in, for (offset = 0; offset <= length_in - ctx->unitsize; offset += ctx->unitsize) { sample = data_in + offset; - for (p = 0; p < ctx->num_enabled_probes; p++) { + for (p = 0; p < ctx->num_enabled_channels; p++) { c = (sample[p / 8] & ((uint8_t) 1 << (p % 8))) ? '1' : '0'; ctx->linebuf[p * ctx->linebuf_len + ctx->line_offset] = c; @@ -79,7 +79,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in, /* Add a space every 8th bit. */ if ((ctx->spl_cnt & 7) == 0) { - for (p = 0; p < ctx->num_enabled_probes; p++) + for (p = 0; p < ctx->num_enabled_channels; p++) ctx->linebuf[p * ctx->linebuf_len + ctx->line_offset] = ' '; ctx->line_offset++;