From c07d0c2d2f6f7b0eb6e92cc6204bf05037957e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 1 Sep 2014 15:43:52 +0200 Subject: Imported Upstream version 1.6.3 --- spectro/dtp20.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'spectro/dtp20.c') diff --git a/spectro/dtp20.c b/spectro/dtp20.c index 84c4f2b..b378f50 100644 --- a/spectro/dtp20.c +++ b/spectro/dtp20.c @@ -7,7 +7,7 @@ * Author: Graeme W. Gill * Date: 10/3/2001 * - * Copyright 1996 - 2013, Graeme W. Gill + * Copyright 1996 - 2014, Graeme W. Gill * All rights reserved. * * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :- @@ -108,7 +108,7 @@ char *in, /* In string */ char *out, /* Out string buffer */ int bsize, /* Out buffer size */ double to) { /* Timout in seconts */ - char tc = '>'; /* Terminating character */ + char *tc = ">"; /* Terminating character */ int ntc = 1; /* Number of terminating characters */ int rv, se, insize; @@ -128,7 +128,7 @@ double to) { /* Timout in seconts */ } rv = DTP20_OK; - if (tc == '>' && ntc == 1) { /* Expecting DTP type error code */ + if (tc[0] == '>' && ntc == 1) { /* Expecting DTP type error code */ rv = extract_ec(out); if (rv > 0) { rv &= inst_imask; @@ -221,8 +221,8 @@ dtp20_init_coms(inst *pp, baud_rate br, flow_control fc, double tout) { dtp20_command(p, "0PR\r", buf, MAX_MES_SIZE, 0.5); } else { - a1logd(p->log, 1, "dtp20: Failed to find connection to instrument\n"); - return inst_coms_fail; + a1logd(p->log, 1, "dtp20: wrong communications type for device\n"); + return inst_internal_error; } /* Check instrument is responding */ @@ -551,6 +551,7 @@ ipatch *vals) { /* Pointer to array of values */ if ((ev = dtp20_command(p, "0518CF\r", buf, MAX_RD_SIZE, 0.5)) != inst_ok) return ev; } + } a1logv(p->log, 1, "All saved strips read\n"); @@ -779,6 +780,7 @@ ipatch *vals) { /* Pointer to array of instrument patch values */ return ev; } + /* Wait for status to change */ for (;;) { if ((ev = dtp20_command(p, "CS\r", buf, MAX_MES_SIZE, 0.2)) != inst_ok) { @@ -1006,6 +1008,7 @@ instClamping clamp) { /* NZ if clamp XYZ/Lab to be +ve */ return ev; } + if (!IMODETST(p->mode, inst_mode_s_ref_spot)) { /* Clear the spot database so our reading doesn't appear as a stored reading */ -- cgit v1.2.3