summaryrefslogtreecommitdiff
path: root/spectro/ss_imp.c
diff options
context:
space:
mode:
Diffstat (limited to 'spectro/ss_imp.c')
-rw-r--r--spectro/ss_imp.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/spectro/ss_imp.c b/spectro/ss_imp.c
index 6f184b3..05f0602 100644
--- a/spectro/ss_imp.c
+++ b/spectro/ss_imp.c
@@ -511,7 +511,7 @@ void ss_command(ss *p, double tmo) {
p->sbuf[2] = '\00'; /* write_read terminates on nul */
p->rbuf = p->_rbuf; /* Reset read pointer */
- if ((se = p->icom->write_read(p->icom, p->_sbuf, 0, p->_rbuf, SS_MAX_RD_SIZE, NULL, "\n", 1, tmo)) != 0) {
+ if ((se = p->icom->write_read_ex(p->icom, p->_sbuf, 0, p->_rbuf, SS_MAX_RD_SIZE, NULL, "\n", 1, tmo, 1)) != 0) {
p->snerr = icoms2ss_err(se);
return;
}
@@ -631,7 +631,7 @@ char pn[9], /* Return the part number */
unsigned int *sn, /* Return serial number */
char sv[13] /* Return software version */
) {
- char rsv[17]; /* Space for resered field */
+ char rsv[17]; /* Space for reserved field */
ss_add_soreq(p, ss_DeviceDataRequest);
ss_command(p, DF_TMO);
ss_sub_soans(p, ss_DeviceDataAnswer);
@@ -866,13 +866,13 @@ int ct /* Color temperature to set for illuminant Dxx in deg K/100 */
return ss_inst_err(p);
}
-/* Queries the spectra of the white reference for the desired filter */
+/* Queries the spectra of the white tile reference for the desired filter */
inst_code so_do_WhiteReferenceRequest(
ss *p,
ss_aft af, /* Filter being queried (None/Pol/D65/UV/custom */
ss_aft *raf, /* Return filter being queried (None/Pol/D65/UV/custom */
double sp[36], /* Return 36 spectral values */
-ss_owrt *owr, /* Return original white reference */
+ss_owrt *owr, /* Return original white reference (i.e. factory/user) */
char dtn[19] /* Return name of data table */
) {
int i;
@@ -890,6 +890,7 @@ char dtn[19] /* Return name of data table */
}
/* Load spectra of a user defined white reference for the desired filter. */
+/* This lets the user override the factory white tile calibration */
/* A name can be given to the white reference. */
inst_code so_do_WhiteReferenceDownld(
ss *p,
@@ -1312,12 +1313,20 @@ ss_toost oo /* Activated/Deactivated */
/* Initialise the device. Scans the Spectrolino */
/* (Doesn't work when device is offline ) */
inst_code ss_do_ScanInitializeDevice(ss *p) {
+ inst_code rv;
ss_add_ssreq(p, ss_InitializeDevice);
ss_command(p, IT_TMO);
ss_sub_ssans(p, ss_ErrorAnswer);
ss_incorp_scanerr(p, ss_sub_1(p));
chended(p);
- return ss_inst_err(p);
+ rv = ss_inst_err(p);
+
+ if (rv != inst_ok)
+ return rv;
+
+ /* Wait for Spectroscan to finish init. */
+ msec_sleep(3000);
+ return rv;
}
/* Establish communications between the SpectroScan and Spectrolino */