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

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sat Nov 21 01:19:46 2009 +0100

analogy: fix a scan size miscalculation in cmd_read

If the acquisition size is not 8 bits round (like 12 bits), the scan
size in bytes was not correct (one byte was missing).

---

 src/utils/analogy/cmd_read.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index 90518d9..f665ccd 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -238,7 +238,8 @@ int main(int argc, char *argv[])
                        printf("\t range's size = %d (bits)\n", info->nb_bits);
                }
 
-               scan_size += info->nb_bits / 8;
+               scan_size += (info->nb_bits % 8 == 0) ? 
+                       info->nb_bits / 8 : (info->nb_bits / 8) + 1;
        }
 
        if (verbose != 0) {


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

Reply via email to