summaryrefslogtreecommitdiff
path: root/spectro/i1disp.c
diff options
context:
space:
mode:
Diffstat (limited to 'spectro/i1disp.c')
-rw-r--r--spectro/i1disp.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/spectro/i1disp.c b/spectro/i1disp.c
index b9da1e1..cb5472b 100644
--- a/spectro/i1disp.c
+++ b/spectro/i1disp.c
@@ -7,7 +7,7 @@
* Author: Graeme W. Gill
* Date: 18/10/2006
*
- * 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 :-
@@ -368,7 +368,7 @@ i1disp_rdreg_float(
if ((ev = i1disp_rdreg_word(p, &val, addr)) != inst_ok)
return ev;
- if (ev == 0xffffffff) {
+ if (val == 0xffffffff) {
return I1DISP_FLOAT_NOT_SET;
}
@@ -1233,13 +1233,8 @@ i1disp_take_XYZ_measurement(
if ((ev = i1d1_take_measurement(p, 0, rgb)) != inst_ok)
return ev;
} else { /* i1 disp 2 or ColorMunki Smile */
- int refreshm = 0; /* Assume non-refresh mode */
- if (p->refrmode && !IMODETST(p->mode, inst_mode_emis_ambient)) {
- refreshm = 1;
- }
-
- if ((ev = i1d2_take_measurement(p, refreshm, rgb)) != inst_ok)
+ if ((ev = i1d2_take_measurement(p, p->refrmode, rgb)) != inst_ok)
return ev;
}
@@ -1703,9 +1698,9 @@ i1disp_compute_factors(
if (p->reg90_W == 0xffffffff)
return i1disp_interp_code((inst *)p, I1DISP_BAD_CRT_CALIBRATION);
- /* Compute ambient matrix */
+ /* Compute ambient matrix for Lux */
for (i = 0; i < 9; i++)
- p->amb[i] = p->reg144_F[i % 3] * 0.5 * (p->reg4_F[i] + p->reg54_F[i]);
+ p->amb[i] = 3.141592654 * p->reg144_F[i % 3] * 0.5 * (p->reg4_F[i] + p->reg54_F[i]);
/* Integration clock frequency */
p->iclk_freq = 1.0/(p->reg40_S * 1e-9);
@@ -1746,8 +1741,8 @@ i1disp_init_coms(inst *pp, baud_rate br, flow_control fc, double tout) {
a1logd(p->log, 2, "i1disp: About to init coms\n");
if (p->icom->port_type(p->icom) != icomt_usb) {
- a1logd(p->log, 1, "i1disp_init_coms: coms is not the right type!\n");
- return i1disp_interp_code((inst *)p, I1DISP_UNKNOWN_MODEL);
+ a1logd(p->log, 1, "i1disp_init_coms: wrong communications type for device!\n");
+ return inst_coms_fail;
}
/* Set config, interface, write end point, read end point */
@@ -1904,6 +1899,7 @@ instClamping clamp) { /* NZ if clamp XYZ/Lab to be +ve */
val->sp.spec_n = 0;
val->duration = 0.0;
+
if (user_trig)
return inst_user_trig;
return rv;
@@ -1927,8 +1923,8 @@ double mtx[3][3]
icmSetUnity3x3(p->ccmat);
} else {
if (p->cbid == 0) {
- a1loge(p->log, 1, "spyd2: can't set col_cor_mat over non base display type\n");
- inst_wrong_setup;
+ a1loge(p->log, 1, "spyd2: can't set col_cor_mat over non-base display type\n");
+ return inst_wrong_setup;
}
icmCpy3x3(p->ccmat, mtx);
}
@@ -2029,8 +2025,8 @@ char id[CALIDLEN] /* Condition identifier (ie. white reference ID) */
} else { /* Eye-One Display 2 */
if ((*calt & inst_calt_ref_freq) && p->refrmode != 0) {
- if (*calc != inst_calc_emis_white) {
- *calc = inst_calc_emis_white;
+ if (*calc != inst_calc_emis_80pc) {
+ *calc = inst_calc_emis_80pc;
return inst_cal_setup;
}
@@ -2243,7 +2239,8 @@ inst3_capability *pcap3) {
| inst_mode_emis_norefresh_ovd
;
- cap2 |= inst2_refresh_rate
+ cap2 |= inst2_get_refresh_rate
+ | inst2_set_refresh_rate
| inst2_emis_refr_meas
;
}
@@ -2331,7 +2328,7 @@ inst_disptypesel smile_disptypesel[3] = {
{
inst_dtflags_default, /* flags */
1, /* cbix */
- "f", /* sel */
+ "fl", /* sel */
"LCD with CCFL backlight", /* desc */
0, /* refr */
1 /* ix */
@@ -2580,7 +2577,7 @@ static void dump_bytes(a1log *log, char *pfx, unsigned char *buf, int base, int
bp += sprintf(bp,".");
}
bp += sprintf(bp,"\n");
- a1logd(log,0,oline);
+ a1logd(log,0,"%s",oline);
bp = oline;
}
}