MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / send_samples

Function send_samples

libsigrok4DSL/input/in_vcd.c:401–432  ·  view source on GitHub ↗

Send N samples of the given value. */

Source from the content-addressed store, hash-verified

399
400/* Send N samples of the given value. */
401static void send_samples(const struct sr_dev_inst *sdi, uint64_t sample, uint64_t count)
402{
403 struct sr_datafeed_packet packet;
404 struct sr_datafeed_logic logic;
405 uint64_t buffer[CHUNKSIZE];
406 uint64_t i;
407 unsigned chunksize = CHUNKSIZE;
408
409 if (count < chunksize)
410 chunksize = count;
411
412 for (i = 0; i < chunksize; i++)
413 {
414 buffer[i] = sample;
415 }
416
417 packet.type = SR_DF_LOGIC;
418 packet.payload = &logic;
419 logic.unitsize = sizeof(uint64_t);
420 logic.data = buffer;
421
422 while (count)
423 {
424 if (count < chunksize)
425 chunksize = count;
426
427 logic.length = sizeof(uint64_t) * chunksize;
428
429 ds_data_forward(sdi, &packet);
430 count -= chunksize;
431 }
432}
433
434/* Parse the data section of VCD */
435static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct context *ctx)

Callers 1

parse_contentsFunction · 0.85

Calls 1

ds_data_forwardFunction · 0.85

Tested by

no test coverage detected