diff --git a/src/drv/drvEpvxi.c b/src/drv/drvEpvxi.c index 81001386a..fb6277236 100644 --- a/src/drv/drvEpvxi.c +++ b/src/drv/drvEpvxi.c @@ -56,6 +56,8 @@ * .17 joh 08-21-92 cleaned up A24/A32 MXI setup * .18 joh 08-26-92 dont return error if a make or model * has already been registered + * .19 joh 09-03-92 Use the correct routine in NIVXI + * for CPU030 trigger routing * * To do * ----- @@ -102,7 +104,7 @@ * vxi_init_ignore_list find addresses of default int handlers * vxi_vec_inuse test for int vector in use * vxi_find_offset find LA for a DC device to assume - * continuemxi_map mat the addresses on a MXI bus extender + * mxi_map mat the addresses on a MXI bus extender * vxi_find_mxi_devices search for and open mxi bus repeaters * map_mxi_inward map from a VXI crate towards the RM * vxi_address_config setup A24 and A32 offsets @@ -132,8 +134,8 @@ static char *sccsId = "$Id$\t$Date$"; -#include #include +#include #ifdef V5_vxWorks # include #else @@ -238,6 +240,14 @@ char epvxiSymbolTableMakeIdString[] = "%03x"; #define EPVXI_MAX_SYMBOLS (1<= 0){ - return VXI_SUCCESS; - } + + for( i=0; + i> 1, + io_map = io_map >> 1, + i++){ + + int (*pfunc)(); + int src; + int dest; + + if(!(enable_map&1)){ + continue; + } + + if(io_map&1){ + src = TRIG_LINE_FPOUT; + dest = TRIG_LINE_ECL_BASE + i; + } + else{ + src = TRIG_LINE_FPIN; + dest = TRIG_LINE_ECL_BASE + i; + } + + pfunc = pnivxi_func[(unsigned)e_MapTrigToTrig]; + status = (*pfunc)( + la, + src, + dest, + 0); + if(status < 0){ + logMsg( "%s: NI030 ECL trig map fail %d %d\n", + __FILE__, + la, + status); + return VXI_BAD_TRIG_IO; + } + + } + return VXI_SUCCESS; } } @@ -2760,6 +2804,7 @@ unsigned io_map /* bits 0-5 correspond to trig 0-5 */ struct vxi_csr *pcsr; unsigned mask; int status; + int i; plac = epvxiLibDeviceList[la]; if(plac){ @@ -2780,16 +2825,49 @@ unsigned io_map /* bits 0-5 correspond to trig 0-5 */ /* * NI CPU030 trigger routing */ - if(pnivxi_func[(unsigned)e_MapTTLtrig] && + if(pnivxi_func[(unsigned)e_MapTrigToTrig] && pnivxi_func[(unsigned)e_GetMyLA]){ if(la == (*pnivxi_func[(unsigned)e_GetMyLA])()){ - status = (*pnivxi_func[(unsigned)e_MapTTLtrig])( - la, - enable_map, - ~io_map); - if(status >= 0){ - return VXI_SUCCESS; - } + + for( i=0; + i> 1, + io_map = io_map >> 1, + i++){ + + int (*pfunc)(); + int src; + int dest; + + if(!(enable_map&1)){ + continue; + } + + if(io_map&1){ + src = TRIG_LINE_FPOUT; + dest = TRIG_LINE_TTL_BASE + i; + } + else{ + src = TRIG_LINE_FPIN; + dest = TRIG_LINE_TTL_BASE + i; + } + + pfunc = pnivxi_func[(unsigned)e_MapTrigToTrig]; + status = (*pfunc)( + la, + src, + dest, + 0); + if(status < 0){ + logMsg( "%s: NI030 TTL trig map fail %d %d\n", + __FILE__, + la, + status); + return VXI_BAD_TRIG_IO; + } + + } + return VXI_SUCCESS; } }