diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-08-13 08:12:59 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2015-08-13 08:12:59 +0200 |
commit | b655f1b1bac64bf548df9d6d9a8f0b1322171804 (patch) | |
tree | 5a0563d130ce4e00af217c46249315c3c01f9f9a /uca-ufo-camera.c | |
parent | 08f91749121af362aa89599943439837b82cb125 (diff) | |
download | uca-ufo-b655f1b1bac64bf548df9d6d9a8f0b1322171804.tar.gz uca-ufo-b655f1b1bac64bf548df9d6d9a8f0b1322171804.tar.bz2 uca-ufo-b655f1b1bac64bf548df9d6d9a8f0b1322171804.tar.xz uca-ufo-b655f1b1bac64bf548df9d6d9a8f0b1322171804.zip |
Read correct sensor height depending on firmware
Diffstat (limited to 'uca-ufo-camera.c')
-rw-r--r-- | uca-ufo-camera.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/uca-ufo-camera.c b/uca-ufo-camera.c index c55fbab..bbcb150 100644 --- a/uca-ufo-camera.c +++ b/uca-ufo-camera.c @@ -219,6 +219,8 @@ update_properties (UcaUfoCameraPrivate *priv) static gboolean setup_pcilib (UcaUfoCameraPrivate *priv) { + guint32 firmware_version; + priv->handle = pcilib_open("/dev/fpga0", "ipecamera"); if (priv->handle == NULL) { @@ -233,16 +235,20 @@ setup_pcilib (UcaUfoCameraPrivate *priv) priv->property_table = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); N_PROPERTIES = update_properties (priv); - priv->height = read_register_value (priv->handle, "cmosis_number_lines_single"); priv->frequency = read_register_value (priv->handle, "control") >> 31; /* FIXME: this is a fix to prevent wrong assumption about the bitdepth with - * the CMOSIS20000 chip. This should be removed as soon as possible. + * the CMOSIS20000 chip and the height of the sensor in pixels. This should + * be removed as soon as possible. */ - if (read_register_value (priv->handle, "firmware_version") == 6) + if (read_register_value (priv->handle, "firmware_version") == 6) { priv->n_bits = 12; - else + priv->height = read_register_value (priv->handle, "cmosis_number_lines_single"); + } + else { priv->n_bits = read_register_value (priv->handle, "adc_resolution") + 10; + priv->height = read_register_value (priv->handle, "cmosis_number_lines"); + } return TRUE; } |