summaryrefslogtreecommitdiff
path: root/spectro/munki.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-09-07 13:29:54 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-09-07 13:29:54 +0200
commita879b4e708b3e46c9697ba6581687eeb5b02a320 (patch)
treef85acc5cb1a7c0b03a050c879c20cab3deb9f40e /spectro/munki.c
parent556dffcdad42b938bc196819aa463247de709765 (diff)
parentc07d0c2d2f6f7b0eb6e92cc6204bf05037957e82 (diff)
state from 2014-09-07 13:30 MESZ
Diffstat (limited to 'spectro/munki.c')
-rw-r--r--spectro/munki.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/spectro/munki.c b/spectro/munki.c
index 6fa898e..5d4de2d 100644
--- a/spectro/munki.c
+++ b/spectro/munki.c
@@ -7,7 +7,7 @@
* Author: Graeme W. Gill
* Date: 12/1/2009
*
- * Copyright 2006 - 2013, Graeme W. Gill
+ * Copyright 2006 - 2014, Graeme W. Gill
* All rights reserved.
*
* This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :-
@@ -90,8 +90,8 @@ munki_init_coms(inst *pp, baud_rate br, flow_control fc, double tout) {
a1logd(p->log, 2, "munki_init_coms: called\n");
if (p->icom->port_type(p->icom) != icomt_usb) {
- a1logd(p->log, 1, "munki_init_coms: wrong sort of coms!\n");
- return munki_interp_code(p, MUNKI_UNKNOWN_MODEL);
+ a1logd(p->log, 1, "munki_init_coms: wrong communications type for device!\n");
+ return inst_coms_fail;
}
a1logd(p->log, 2, "munki_init_coms: about to init USB\n");
@@ -145,8 +145,10 @@ munki_determine_capabilities(munki *p) {
if (p->m != NULL) {
munkiimp *m = (munkiimp *)p->m;
munki_state *s = &m->ms[m->mmode];
- if (s->emiss)
+ if (s->emiss) {
p->cap2 |= inst2_emis_refr_meas;
+ p->cap2 |= inst2_meas_disp_update;
+ }
}
p->cap3 = inst3_none;
@@ -314,6 +316,25 @@ double *ref_rate) {
rv = munki_imp_meas_refrate(p, ref_rate);
+
+ return munki_interp_code(p, rv);
+}
+
+/* Read the display update delay */
+static inst_code
+munki_meas_delay(
+inst *pp,
+int *msecdelay) {
+ munki *p = (munki *)pp;
+ munki_code rv;
+
+ if (!p->gotcoms)
+ return inst_no_coms;
+ if (!p->inited)
+ return inst_no_init;
+
+ rv = munki_imp_meas_delay(p, msecdelay);
+
return munki_interp_code(p, rv);
}
@@ -425,6 +446,8 @@ munki_interp_error(inst *pp, munki_code ec) {
return "No ambient found before first flash";
case MUNKI_RD_NOREFR_FOUND:
return "No refresh rate detected or failed to measure it";
+ case MUNKI_RD_NOTRANS_FOUND:
+ return "No delay calibration transition found";
case MUNKI_SPOS_PROJ:
return "Sensor should be in projector position";
@@ -557,6 +580,7 @@ munki_interp_code(munki *p, munki_code ec) {
case MUNKI_RD_NOFLASHES:
case MUNKI_RD_NOAMBB4FLASHES:
case MUNKI_RD_NOREFR_FOUND:
+ case MUNKI_RD_NOTRANS_FOUND:
return inst_misread | ec;
case MUNKI_INTERNAL_ERROR:
@@ -700,8 +724,7 @@ inst_code munki_set_mode(inst *pp, inst_mode m) {
if ((mmode = munki_convert_mode(p, m)) == mk_no_modes)
return inst_unsupported;
- if ((rv = munki_interp_code(p, munki_imp_set_mode(p, mmode, m & inst_mode_spectral)))
- != inst_ok)
+ if ((rv = munki_interp_code(p, munki_imp_set_mode(p, mmode, m))) != inst_ok)
return rv;
munki_determine_capabilities(p);
@@ -920,6 +943,7 @@ extern munki *new_munki(icoms *icom, instType itype) {
p->read_refrate = munki_read_refrate;
p->get_n_a_cals = munki_get_n_a_cals;
p->calibrate = munki_calibrate;
+ p->meas_delay = munki_meas_delay;
p->interp_error = munki_interp_error;
p->config_enum = munki_config_enum;
p->del = munki_del;