[aravis/wip/emmanuel/bigendian] genicam: bigendian second try
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis/wip/emmanuel/bigendian] genicam: bigendian second try
- Date: Sat, 2 May 2015 17:42:55 +0000 (UTC)
commit 1cec5a77f03f5f25f8f313ffe08aed73b3ec24bc
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sat May 2 19:42:23 2015 +0200
genicam: bigendian second try
src/arvgcregisternode.c | 25 +++++--------------------
1 files changed, 5 insertions(+), 20 deletions(-)
---
diff --git a/src/arvgcregisternode.c b/src/arvgcregisternode.c
index 48e2da9..6a15d55 100644
--- a/src/arvgcregisternode.c
+++ b/src/arvgcregisternode.c
@@ -706,33 +706,25 @@ _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 {
lsb = 8 * gc_register_node->cache_size - register_lsb - 1;
msb = 8 * gc_register_node->cache_size - register_msb - 1;
}
+
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 G_BYTE_ORDER == G_LITTLE_ENDIAN
if (msb - lsb < 63)
mask = ((((guint64) 1) << (msb - lsb + 1)) - 1) << lsb;
else
mask = G_MAXUINT64;
value = (value & mask) >> lsb;
-#else
- if (lsb - msb < 63)
- mask = ((((guint64) 1) << (lsb - msb + 1)) - 1) << msb;
- else
- mask = G_MAXUINT64;
- value = (value & mask) >> lsb;
-#endif
arv_log_genicam ("[GcRegisterNode::_get_integer_value] mask = 0x%08Lx", mask);
}
@@ -805,32 +797,25 @@ _set_integer_value (ArvGcRegisterNode *gc_register_node, guint register_lsb, gui
arv_copy_memory_with_endianess (¤t_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 {
lsb = 8 * gc_register_node->cache_size - register_lsb - 1;
msb = 8 * gc_register_node->cache_size - register_msb - 1;
}
+
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 G_BYTE_ORDER == G_LITTLE_ENDIAN
if (msb - lsb < 63)
mask = ((((guint64) 1) << (msb - lsb + 1)) - 1) << lsb;
else
mask = G_MAXUINT64;
value = ((value << lsb) & mask) | (current_value & ~mask);
-#else
- if (lsb - msb < 63)
- mask = ((((guint64) 1) << (lsb - msb + 1)) - 1) << msb;
- else
- mask = G_MAXUINT64;
-
- value = ((value << msb) & mask) | (current_value & ~mask);
-#endif
+
arv_log_genicam ("[GcRegisterNode::_get_integer_value] mask = 0x%08Lx", mask);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]