From: Paul C. <pa...@us...> - 2005-09-29 14:12:32
|
Update of /cvsroot/emc/emc2/src/emc/drivers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9206/src/emc/drivers Modified Files: Tag: bdi-4_30 Makefile dro.c extintf.h extppt.c extsmdromot.c extsmmot.c parport.c parport.h realtimeio.c stgdiag.c Log Message: Changes that go to make up the final BDI-4 release. Index: extintf.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/extintf.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.4.4.1 diff -C2 -d -r1.1.2.4 -r1.1.2.4.4.1 *** extintf.h 8 Mar 2005 20:51:51 -0000 1.1.2.4 --- extintf.h 29 Sep 2005 14:10:39 -0000 1.1.2.4.4.1 *************** *** 332,348 **** extern int extDioByteWrite(int index, unsigned char byte); - #if 0 - /* These following functions are not used - Do *we* really need - them ? - Just uses up space and adds to the overhead for - anyone coding a driver... */ - /* byte, short, and word reads, writes. Index starts at 0, indexes up - through bytes, short ints, and ints */ - extern int extDioShortRead(int index, unsigned short *sh); - extern int extDioWordRead(int index, unsigned int *word); - extern int extDioShortWrite(int index, unsigned short sh); - extern int extDioWordWrite(int index, unsigned int word); - extern int extDioShortCheck(int index, unsigned short *sh); - extern int extDioWordCheck(int index, unsigned int *word); - #endif /* Analog I/O model --- 332,335 ---- Index: parport.h =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/parport.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.4.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.4.1 *** parport.h 23 Feb 2005 11:29:01 -0000 1.1.2.2 --- parport.h 29 Sep 2005 14:10:39 -0000 1.1.2.2.4.1 *************** *** 61,76 **** extern int pptDioCheck(int index, int *value); ! /* byte, short, and word reads, writes. Index starts at 0, indexes up ! through bytes, short ints, and ints */ extern int pptDioByteRead(int index, unsigned char *byte); - extern int pptDioShortRead(int index, unsigned short *sh); - extern int pptDioWordRead(int index, unsigned int *word); extern int pptDioByteWrite(int index, unsigned char byte); - extern int pptDioShortWrite(int index, unsigned short sh); - extern int pptDioWordWrite(int index, unsigned int word); extern int pptDioByteCheck(int index, unsigned char *byte); - extern int pptDioShortCheck(int index, unsigned short *sh); - extern int pptDioWordCheck(int index, unsigned int *word); - #ifdef __cplusplus --- 61,68 ---- extern int pptDioCheck(int index, int *value); ! /* byte reads, writes. Index starts at 0, indexes up */ extern int pptDioByteRead(int index, unsigned char *byte); extern int pptDioByteWrite(int index, unsigned char byte); extern int pptDioByteCheck(int index, unsigned char *byte); #ifdef __cplusplus Index: Makefile =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/Makefile,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.9.4.1 diff -C2 -d -r1.1.2.9 -r1.1.2.9.4.1 *** Makefile 4 Mar 2005 10:57:01 -0000 1.1.2.9 --- Makefile 29 Sep 2005 14:10:39 -0000 1.1.2.9.4.1 *************** *** 6,11 **** dro.h \ extintf.h \ ! parport.h \ ! vital.h SRCS = dro.c \ --- 6,10 ---- dro.h \ extintf.h \ ! parport.h SRCS = dro.c \ *************** *** 25,47 **** RT_SRCS = dro.c \ extsmdromot.c \ - extvitalmot.c \ extppt.c \ extsmmot.c \ ! parport.c \ ! vital.c RT_OBJS = dro.o \ extsmdromot.o \ - extvitalmot.o \ extppt.o \ extsmmot.o \ ! parport.o \ ! vital.o endif BINS = drotest \ ppttest \ ! s526diag \ ! ioctl_test all: headers $(OBJS:%.o=$(TMP_DIR)/%.o) $(RT_OBJS:%.o=$(RTTMP_DIR)/%.o) \ --- 24,41 ---- RT_SRCS = dro.c \ extsmdromot.c \ extppt.c \ extsmmot.c \ ! parport.c RT_OBJS = dro.o \ extsmdromot.o \ extppt.o \ extsmmot.o \ ! parport.o endif BINS = drotest \ ppttest \ ! s526diag all: headers $(OBJS:%.o=$(TMP_DIR)/%.o) $(RT_OBJS:%.o=$(RTTMP_DIR)/%.o) \ *************** *** 76,84 **** (cd sensoray; make $@) (cd simio; make $@) ! kclean: (cd ppmc; make $@) (cd sensoray; make $@) (cd simio; make $@) - rm -f .*.cmd *.o* *.mod.* *.ko - rm -fR .tmp_versions --- 70,80 ---- (cd sensoray; make $@) (cd simio; make $@) ! (cd vital; make $@) ! kclean: (cd ppmc; make $@) (cd sensoray; make $@) (cd simio; make $@) + (cd vital; make $@) - rm -f .*.cmd *.o* *.mod.* *.ko - rm -fR .tmp_versions Index: parport.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/parport.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.3.4.1 diff -C2 -d -r1.1.2.3 -r1.1.2.3.4.1 *** parport.c 5 Mar 2005 18:31:13 -0000 1.1.2.3 --- parport.c 29 Sep 2005 14:10:39 -0000 1.1.2.3.4.1 *************** *** 38,41 **** --- 38,42 ---- #ifdef MAIN + #include "config.h" #include <stdio.h> #include <stdlib.h> *************** *** 244,273 **** } - int pptDioShortRead(int index, unsigned short *sh) - { - if (index != 0) - { - *sh = 0; - return -1; - } - - *sh = (unsigned short) inb(IO_BASE_ADDRESS + 1); - *sh >>= 3; /* shift down since S3 is bit 0, etc. */ - return 0; - } - - int pptDioWordRead(int index, unsigned int *word) - { - if (index != 0) - { - *word = 0; - return -1; - } - - *word = (unsigned int) inb(IO_BASE_ADDRESS + 1); - *word >>= 3; /* shift down since S3 is bit 0, etc. */ - return 0; - } - int pptDioByteWrite(int index, unsigned char byte) { --- 245,248 ---- *************** *** 287,300 **** } - int pptDioShortWrite(int index, unsigned short sh) - { - return pptDioByteWrite(index, (unsigned char) sh); - } - - int pptDioWordWrite(int index, unsigned int word) - { - return pptDioByteWrite(index, (unsigned char) word); - } - int pptDioByteCheck(int index, unsigned char *byte) { --- 262,265 ---- *************** *** 315,358 **** } - int pptDioShortCheck(int index, unsigned short *sh) - { - unsigned char b0, b1; - - if (index != 0) - { - *sh = 0; - return 0; - } - - b0 = inb(IO_BASE_ADDRESS); - b1 = inb(IO_BASE_ADDRESS + 2); - - *sh = b1; - *sh <<= 8; - *sh += b0; - - return 0; - } - - int pptDioWordCheck(int index, unsigned int *word) - { - unsigned char b0, b1; - - if (index != 0) - { - *word = 0; - return 0; - } - - b0 = inb(IO_BASE_ADDRESS); - b1 = inb(IO_BASE_ADDRESS + 2); - - *word = b1; - *word <<= 8; - *word += b0; - - return 0; - } - #ifdef MAIN --- 280,283 ---- *************** *** 402,408 **** { int t; ! #define INPUTLEN 256 ! char input[INPUTLEN]; ! char cmd[INPUTLEN]; int ins[5]; int outs[12]; --- 327,332 ---- { int t; ! char input[LINELEN]; ! char cmd[LINELEN]; int ins[5]; int outs[12]; *************** *** 448,452 **** fflush(stdout); ! if (NULL == fgets(input, INPUTLEN, stdin)) { /* EOF */ --- 372,376 ---- fflush(stdout); ! if (NULL == fgets(input, LINELEN, stdin)) { /* EOF */ Index: stgdiag.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/stgdiag.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.4.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.4.1 *** stgdiag.c 8 Mar 2005 20:51:51 -0000 1.1.2.2 --- stgdiag.c 29 Sep 2005 14:10:39 -0000 1.1.2.2.4.1 *************** *** 1,3 **** --- 1,4 ---- + #include "config.h" #include <stdio.h> #include <string.h> *************** *** 53,57 **** double volts; int t; ! char buf[80]; char *cptr; double adc[NUM_AXES]; --- 54,58 ---- double volts; int t; ! char buf[BUFFERLEN]; char *cptr; double adc[NUM_AXES]; *************** *** 255,263 **** } else if (which == DAC) { printf("Axis? "); ! fgets(buf, 80, stdin); axis = (int) strtol(buf, 0, 0); while (!done) { printf("DAC(%d): ", axis); ! if (fgets(buf, 80, stdin) == NULL) { break; } --- 256,264 ---- } else if (which == DAC) { printf("Axis? "); ! fgets(buf, BUFFERLEN, stdin); axis = (int) strtol(buf, 0, 0); while (!done) { printf("DAC(%d): ", axis); ! if (fgets(buf, BUFFERLEN, stdin) == NULL) { break; } Index: extppt.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/extppt.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.4.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.4.1 *** extppt.c 20 Feb 2005 03:43:48 -0000 1.1.2.1 --- extppt.c 29 Sep 2005 14:10:39 -0000 1.1.2.1.4.1 *************** *** 62,75 **** } - int extDioShortRead(int index, unsigned short *sh) - { - return pptDioShortRead(index, sh); - } - - int extDioWordRead(int index, unsigned int *word) - { - return pptDioWordRead(index, word); - } - int extDioByteWrite(int index, unsigned char byte) { --- 62,65 ---- *************** *** 77,102 **** } - int extDioShortWrite(int index, unsigned short sh) - { - return pptDioShortWrite(index, sh); - } - - int extDioWordWrite(int index, unsigned int word) - { - return pptDioWordWrite(index, word); - } - int extDioByteCheck(int index, unsigned char *byte) { return pptDioByteCheck(index, byte); } - - int extDioShortCheck(int index, unsigned short *sh) - { - return pptDioShortCheck(index, sh); - } - - int extDioWordCheck(int index, unsigned int *word) - { - return pptDioWordCheck(index, word); - } --- 67,72 ---- Index: realtimeio.c =================================================================== RCS file: /cvsroot/emc/emc2/src/emc/drivers/Attic/realtimeio.c,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.7.4.1 diff -C2 -d -r1.1.2.7 -r1.1.2.7.4.1 *** realtimeio.c 5 Mar 2005 18:31:13 -0000 1.1.2.7 --- realtimeio.c 29 Sep 2005 14:10:39 -0000 1.1.2.7.4.1 *************** *** 22,29 **** --- 22,94 ---- #include <sys/ioctl.h> #include <fcntl.h> + #include "extintf.h" #include "emcmot.h" #include "emcioctl.h" #include "usrmotintf.h" + /* ident tag */ + #ifndef __GNUC__ + #ifndef __attribute__ + #define __attribute__(x) + #endif + #endif + + static char __attribute__((unused)) ident[] = "$Id$"; + + static EMCMOT_COMMAND emcmotCommand; + static EMCMOT_STATUS emcmotStatus; + int IO_BASE_ADDRESS = 0x0080; // Use a dummy IO address.. + + int extDioInit(const char * stuff) + { + return 0; + } + + int extDioQuit(void) + { + return 0; + } + + int extDioRead(int index, int *value) + { + emcmotCommand.command = EMCMOT_READ_INDEX_BIT; + emcmotCommand.index = index; + + usrmotWriteEmcmotCommand(&emcmotCommand); + if (0 != usrmotReadEmcmotStatus(&emcmotStatus)) { + return -1; + } + *value = (emcmotStatus.level) ? 1 : 0; + + return 0; + } + + int extDioWrite(int index, int value) + { + emcmotCommand.command = EMCMOT_READ_INDEX_BIT; + emcmotCommand.index = index; + emcmotCommand.level = value; + return usrmotWriteEmcmotCommand(&emcmotCommand); + } + + int extDioCheck(int index, int *value) + { + emcmotCommand.command = EMCMOT_CHECK_INDEX_BIT; + emcmotCommand.index = index; + + usrmotWriteEmcmotCommand(&emcmotCommand); + if (0 != usrmotReadEmcmotStatus(&emcmotStatus)) { + return -1; + } + *value = (emcmotStatus.level) ? 1 : 0; + return 0; + } + + int extAioWrite(int index, double volts) + { + return 0; + } + + #if 0 static int emc_fd = -1; // File descriptor for h/w accesses. *************** *** 119,123 **** { int tmp = 0; ! char buf[256] = "I'm just an empty string"; rtDioInit("stuff\n"); printf("Model %s\n", rtModel(buf)); --- 184,188 ---- { int tmp = 0; ! char buf[LINELEN] = "I'm just an empty string"; rtDioInit("stuff\n"); printf("Model %s\n", rtModel(buf)); *************** *** 129,130 **** --- 194,196 ---- } #endif + #endif |