demo: Fixed glitching in increment signal

This commit is contained in:
Joel Holdsworth 2013-04-13 16:08:52 +01:00 committed by Bert Vermeulen
parent f0b6ae19a8
commit bbd7ef0f18
1 changed files with 3 additions and 4 deletions

View File

@ -347,9 +347,8 @@ static void samples_generator(uint8_t *buf, uint64_t size,
switch (devc->sample_generator) {
case PATTERN_SIGROK: /* sigrok pattern */
for (i = 0; i < size; i++) {
*(buf + i) = ~(pattern_sigrok[p] >> 1);
if (++p == 64)
p = 0;
*(buf + i) = ~(pattern_sigrok[
p++ % sizeof(pattern_sigrok)] >> 1);
}
break;
case PATTERN_RANDOM: /* Random */
@ -358,7 +357,7 @@ static void samples_generator(uint8_t *buf, uint64_t size,
break;
case PATTERN_INC: /* Simple increment */
for (i = 0; i < size; i++)
*(buf + i) = i;
*(buf + i) = p++;
break;
case PATTERN_ALL_LOW: /* All probes are low */
memset(buf, 0x00, size);