[aravis/wip/emmanuel/bigendian] genicam: bigendian support



commit df9cff51c4bf103c5bd8512e84c1416e067b3bcd
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Wed May 27 16:49:12 2015 +0200

    genicam: bigendian support

 src/arvgcregisternode.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/arvgcregisternode.c b/src/arvgcregisternode.c
index 5d40c8b..6a15d55 100644
--- a/src/arvgcregisternode.c
+++ b/src/arvgcregisternode.c
@@ -706,7 +706,7 @@ _get_integer_value (ArvGcRegisterNode *gc_register_node, guint register_lsb, gui
            gc_register_node->type == ARV_GC_REGISTER_NODE_TYPE_STRUCT_REGISTER) {
                guint64 mask;
 
-               if (endianess == G_BYTE_ORDER) {
+               if (endianess == G_LITTLE_ENDIAN) {
                        msb = register_msb;
                        lsb = register_lsb;
                } else {
@@ -714,16 +714,18 @@ _get_integer_value (ArvGcRegisterNode *gc_register_node, guint register_lsb, gui
                        msb = 8 * gc_register_node->cache_size - register_msb - 1;
                }
 
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] reglsb = %d, regmsb, %d, lsb = %d, msb 
= %d",
+                                register_lsb, register_msb, lsb, msb);
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] value = 0x%08Lx", value);
+
                if (msb - lsb < 63)
                        mask = ((((guint64) 1) << (msb - lsb + 1)) - 1) << lsb;
                else
                        mask = G_MAXUINT64;
 
                value = (value & mask) >> lsb;
-#else
-               g_assert_not_reached ();
-#endif
+
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] mask  = 0x%08Lx", mask);
        }
 
        arv_log_genicam ("[GcRegisterNode::_get_integer_value] address = 0x%Lx, value = 0x%Lx",
@@ -795,7 +797,7 @@ _set_integer_value (ArvGcRegisterNode *gc_register_node, guint register_lsb, gui
                arv_copy_memory_with_endianess (&current_value, sizeof (current_value), G_BYTE_ORDER,
                                                gc_register_node->cache, gc_register_node->cache_size, 
endianess);
 
-               if (endianess == G_BYTE_ORDER) {
+               if (endianess == G_LITTLE_ENDIAN) {
                        msb = register_msb;
                        lsb = register_lsb;
                } else {
@@ -803,16 +805,18 @@ _set_integer_value (ArvGcRegisterNode *gc_register_node, guint register_lsb, gui
                        msb = 8 * gc_register_node->cache_size - register_msb - 1;
                }
 
-#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] reglsb = %d, regmsb, %d, lsb = %d, msb 
= %d",
+                                register_lsb, register_msb, lsb, msb);
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] value = 0x%08Lx", value);
+
                if (msb - lsb < 63)
                        mask = ((((guint64) 1) << (msb - lsb + 1)) - 1) << lsb;
                else
                        mask = G_MAXUINT64;
 
                value = ((value << lsb) & mask) | (current_value & ~mask);
-#else
-               g_assert_not_reached ();
-#endif
+
+               arv_log_genicam ("[GcRegisterNode::_get_integer_value] mask  = 0x%08Lx", mask);
        }
 
        arv_log_genicam ("[GcRegisterNode::_set_integer_value] address = 0x%Lx, value = 0x%Lx",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]