From 358a84bb97226f60fb888d02e7e7dd1236708d2d Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 8 Oct 2018 19:05:57 +0200 Subject: Retry reading control registers as HZG camera often returns 0xffffffff in ROI mode --- CMakeLists.txt | 4 ++-- uca-ufo-camera.c | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba10a9b..2091f3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,11 +30,11 @@ add_custom_target(dist DEPENDS dist_clean COMMAND ${CMAKE_MAKE_PROGRAM} package_ if (NOT DEFINED CMOSIS_SENSOR_WIDTH) - set(CMOSIS_SENSOR_WIDTH "2048") + set(CMOSIS_SENSOR_WIDTH "5120") endif () if (NOT DEFINED CMOSIS_SENSOR_HEIGHT) - set(CMOSIS_SENSOR_HEIGHT "1088") + set(CMOSIS_SENSOR_HEIGHT "3840") endif () set(CMOSIS_SENSOR_WIDTH ${CMOSIS_SENSOR_WIDTH} CACHE STRING "Width of the sensor") diff --git a/uca-ufo-camera.c b/uca-ufo-camera.c index 94d1d3c..61bf8a6 100644 --- a/uca-ufo-camera.c +++ b/uca-ufo-camera.c @@ -288,7 +288,12 @@ set_control_bit (UcaUfoCameraPrivate *priv, guint bit, gboolean set) pcilib_register_value_t flags; pcilib_register_value_t mask; - flags = read_register_value (priv->handle, name); + do { + flags = read_register_value (priv->handle, name); + usleep(10000); +// printf("%lx\n", flags); + } while ((flags&0xffffffff) == 0xffffffff); + mask = 1 << bit; if (set) -- cgit v1.2.3