summaryrefslogtreecommitdiffstats
path: root/plugins/ufo
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ufo')
-rw-r--r--plugins/ufo/uca-ufo-camera.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/ufo/uca-ufo-camera.c b/plugins/ufo/uca-ufo-camera.c
index c413278..f09d03a 100644
--- a/plugins/ufo/uca-ufo-camera.c
+++ b/plugins/ufo/uca-ufo-camera.c
@@ -410,7 +410,8 @@ uca_ufo_camera_set_property(GObject *object, guint property_id, const GValue *va
case PROP_EXPOSURE_TIME:
{
const guint frequency = priv->frequency == FPGA_40MHZ ? 40 : 48;
- pcilib_register_value_t reg_value = (pcilib_register_value_t) 129 / frequency * 1000 * 1000 * g_value_get_double(value);
+ const gdouble user_exposure_time = g_value_get_double(value);
+ pcilib_register_value_t reg_value = (pcilib_register_value_t) (10e6 * user_exposure_time) / (129 * frequency);
pcilib_write_register(priv->handle, NULL, "cmosis_exp_time", reg_value);
}
break;
@@ -491,7 +492,7 @@ uca_ufo_camera_get_property(GObject *object, guint property_id, GValue *value, G
case PROP_EXPOSURE_TIME:
{
const gdouble frequency = priv->frequency == FPGA_40MHZ ? 40.0 : 48.0;
- g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129 / frequency / 1000 / 1000 );
+ g_value_set_double (value, read_register_value (priv->handle, "cmosis_exp_time") * 129 * frequency / 10e6);
}
break;
case PROP_HAS_STREAMING: