summaryrefslogtreecommitdiff
path: root/spectro/ss_imp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-02 19:25:17 +0200
commitc2ca7be5a751879159f3cb591a64bb9568b79762 (patch)
tree04e38d4f4a2aad4d789bda0a65b7abb80a3439a2 /spectro/ss_imp.c
parent45c152c326d87478fbf41714b4b8e2f7b57a282b (diff)
parent3db384424bd7398ffbb7a355cab8f15f3add009f (diff)
Updated version 1.9.1+repack from 'upstream/1.9.1+repack'
with Debian dir 98a996367aa69ae41accf9c6d369f600bc94de80
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 */