Send N samples of the given value. */
| 399 | |
| 400 | /* Send N samples of the given value. */ |
| 401 | static 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 */ |
| 435 | static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct context *ctx) |
no test coverage detected