Module: xenomai-abe
Branch: analogy
Commit: c5c3d9a56107c8aa7ab38ea7d0e8c248538c7372
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c5c3d9a56107c8aa7ab38ea7d0e8c248538c7372

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Thu Dec  2 00:54:37 2010 +0100

analogy: add verbose output in wf_generate tool

---

 src/utils/analogy/wf_generate.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/utils/analogy/wf_generate.c b/src/utils/analogy/wf_generate.c
index 40e518b..97b19c9 100644
--- a/src/utils/analogy/wf_generate.c
+++ b/src/utils/analogy/wf_generate.c
@@ -208,6 +208,18 @@ int main(int argc, char *argv[])
                goto out;
 
        a4l_wf_set_sample_count(&cfg.wf);
+
+       if (cfg.verbose) {
+               char *types[] = {"sine", "sawtooth", "triangular", "steps"};
+               fprintf(stderr, "Waveform type: %s\n", types[cfg.wf.wf_kind]);
+               fprintf(stderr, "Amplitude: %F\n", cfg.wf.wf_amplitude);
+               fprintf(stderr, "Frequency: %F\n", cfg.wf.wf_frequency);
+               fprintf(stderr, "Offset: %F\n", cfg.wf.wf_offset);
+               fprintf(stderr, 
+                       "Sampling frequency: %F\n", cfg.wf.spl_frequency);
+               fprintf(stderr, "Samples count: %d\n", cfg.wf.spl_count);
+               fprintf(stderr, "Output file: %s\n", cfg.filename);
+       }
        
        values = malloc(cfg.wf.spl_count * sizeof(double));
        if (!values) {
@@ -225,6 +237,14 @@ int main(int argc, char *argv[])
                goto out;
        }       
 
+       if (cfg.verbose) {
+               int i;
+
+               fprintf(stderr, "Dumping values:\n");
+               for (i = 0; i < cfg.wf.spl_count; i++)
+                       fprintf(stderr, "[%d]: %F\n", i, values[i]);
+       }
+
 out:
        cleanup_config(&cfg);
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to