From: Pat Thoyts Date: Wed, 4 Nov 2009 22:09:18 +0000 (+0000) Subject: Changed option name to 'bitmode' to avoid clash with serial mode option. X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=09c7da92fe504c32955e80dd1e95fb6f9c6fbdcf;p=tclftd2xx Changed option name to 'bitmode' to avoid clash with serial mode option. Version incremented Signed-off-by: Pat Thoyts --- diff --git a/makefile.vc b/makefile.vc index 4f204b7..ceb32e9 100644 --- a/makefile.vc +++ b/makefile.vc @@ -164,7 +164,7 @@ PROJECT = tclftd2xx #PROJECT_REQUIRES_TK=1 !include "rules.vc" -DOTVERSION = 1.0.1 +DOTVERSION = 1.0.2 VERSION = $(DOTVERSION:.=) STUBPREFIX = $(PROJECT)stub @@ -175,11 +175,15 @@ DLLOBJS = \ !endif # We need the location of the FTDI header and library files. -FTDI_INCLUDES =-ID2XX\WHQL +!ifndef FTDI_DIR +FTDI_DIR =D2XX\WHQL +!endif + +FTDI_INCLUDES =-I$(FTDI_DIR) !if "$(MACHINE)" == "AMD64" -FTDI_LIBS =-libpath:D2XX\WHQL\amd64 +FTDI_LIBS =-libpath:$(FTDI_DIR)\amd64 !else -FTDI_LIBS =-libpath:D2XX\WHQL\i386 +FTDI_LIBS =-libpath:$(FTDI_DIR)\i386 !endif #------------------------------------------------------------------------- diff --git a/tclftd2xx.c b/tclftd2xx.c index 884d962..2f6333c 100644 --- a/tclftd2xx.c +++ b/tclftd2xx.c @@ -280,12 +280,13 @@ ChannelSetOption(ClientData instance, Tcl_Interp *interp, if (r == TCL_OK) { fts = procs.FT_SetLatencyTimer(instPtr->handle, (UCHAR)tmp); } - } else if (!strcmp("-mode", optionName)) { + } else if (!strcmp("-bitmode", optionName)) { + int tmp = 1; r = Tcl_GetInt(interp, newValue, &tmp); if (r == TCL_OK) { fts = procs.FT_SetBitmode(instPtr->handle, (UCHAR)(tmp >> 8), (UCHAR)(tmp & 0xff)); } - } + } if (fts != FT_OK) { Tcl_AppendResult(interp, "error setting ", optionName, @@ -307,7 +308,7 @@ ChannelGetOption(ClientData instance, Tcl_Interp *interp, const char *optionName, Tcl_DString *optionValue) { Channel *instPtr = instance; - const char *options[] = {"readtimeout", "writetimeout", "latency", NULL}; + const char *options[] = {"readtimeout", "writetimeout", "latency", "bitmode", NULL}; int r = TCL_OK; if (optionName == NULL) { @@ -348,11 +349,11 @@ ChannelGetOption(ClientData instance, Tcl_Interp *interp, ConvertError(fts), NULL); r = TCL_ERROR; } - } else if (!strcmp("-mode", optionName)) { + } else if (!strcmp("-bitmode", optionName)) { UCHAR bmode = 0; - Tcl_DStringSetLength(&ds, TCL_INTEGER_SPACE); fts = procs.FT_GetBitmode(instPtr->handle, &bmode); if (fts == FT_OK) { + Tcl_DStringSetLength(&ds, TCL_INTEGER_SPACE); sprintf(Tcl_DStringValue(&ds), "%d", bmode); } else { Tcl_AppendResult(interp, "failed to read ", optionName, ": ",