Skip to content

Commit

Permalink
[nrf fromtree] samples: drivers: adc: Allow coverage calculation.
Browse files Browse the repository at this point in the history
Sample must end to dump coverage data.

Signed-off-by: Bartlomiej Buczek <[email protected]>
(cherry picked from commit 79f4f2a)
  • Loading branch information
nordic-babu authored and anangl committed Jun 17, 2024
1 parent 90f792f commit 7cdba41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/drivers/adc/adc_dt/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ int main(void)
return 0;
}
}

#ifndef CONFIG_COVERAGE
while (1) {
#else
for (int k = 0; k < 10; k++) {
#endif
printk("ADC reading[%u]:\n", count++);
for (size_t i = 0U; i < ARRAY_SIZE(adc_channels); i++) {
int32_t val_mv;
Expand Down
4 changes: 4 additions & 0 deletions samples/drivers/adc/adc_sequence/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ int main(void)
}
}

#ifndef CONFIG_COVERAGE
while (1) {
#else
for (int k = 0; k < 10; k++) {
#endif
printf("ADC sequence reading [%u]:\n", count++);
k_msleep(1000);

Expand Down

0 comments on commit 7cdba41

Please sign in to comment.