From 1872ef5f063e82170820360557f61e4327515900 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Thu, 8 Jun 2017 22:29:02 +0200 Subject: [PATCH] dey-examples: adc_cmp_sample: remove sample_rate argument This argument now is only valid for the behavior of the comparator in sleep mode, so it no longer makes sense in this application. Signed-off-by: Sebastian Pastor --- .../files/adc_cmp_sample/adc_cmp_sample.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c index fa3e2073c..bf83f2ec2 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c @@ -35,7 +35,6 @@ " -h : Threshold_high higher limit of the comparator window\n" \ " -l : Threshold_low lower limit of the comparator window\n" \ " -e : edges enabled: 'rising', 'falling' or 'both'\n" \ - " -s : sample_rate how often to sample the input, in 100 ms units.\n"\ " -v : use V for output and thresholds instead of raw values.\n"\ " -? : help\n\n" @@ -264,7 +263,7 @@ exit: } static int configure_comparator(cmp_t *cmp, uint16_t th_l, uint16_t th_h, - uint16_t srate, char *edge) + char *edge) { char *path; char buffer[BUFFER_LEN]; @@ -296,11 +295,6 @@ static int configure_comparator(cmp_t *cmp, uint16_t th_l, uint16_t th_h, if (ret < 0) goto exit; - /* Configure Sample rate */ - sprintf(path, "%s/in_voltage%u_cmp_rate", - cmp->sysfs_dir, cmp->channel); - sprintf(buffer, "%d", srate); - ret = write_in_path(path, buffer); if (ret < 0) goto exit; @@ -326,7 +320,6 @@ int main(int argc, char **argv) char *chrdev_path = NULL; char *edge = NULL; int dev_num; - unsigned int sample_rate = 1; double threshold_low = 0; double threshold_high = 0xFFFF; cmp_t cmp = { @@ -340,7 +333,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - while ((opt = getopt(argc, argv, "c:h:l:s:e:v?")) > 0) { + while ((opt = getopt(argc, argv, "c:h:l:e:v?")) > 0) { switch (opt) { case 'c': cmp.channel = strtoul(optarg, NULL, 10); @@ -351,9 +344,6 @@ int main(int argc, char **argv) case 'l': threshold_low = atof(optarg); break; - case 's': - sample_rate = strtoul(optarg, NULL, 10); - break; case 'e': if (!strcmp(optarg, "rising") && !strcmp(optarg, "falling") && @@ -420,8 +410,7 @@ int main(int argc, char **argv) threshold_low = threshold_low * 1000 / cmp.voltage_scale; } - ret = configure_comparator(&cmp, threshold_low, threshold_high, - sample_rate, edge); + ret = configure_comparator(&cmp, threshold_low, threshold_high, edge); if (ret < 0) goto exit;