From: Frank Mori Hess Date: Tue, 24 Oct 2006 20:46:19 +0000 (+0000) Subject: Initialize pfi output select registers. X-Git-Tag: r0_7_74~174 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=86de698fa24b594881e72cd847937e226e2b9967;p=comedi.git Initialize pfi output select registers. --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 87e28851..3ab9b050 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -3235,7 +3235,11 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) s->insn_bits = ni_pfi_insn_bits; s->insn_config = ni_pfi_insn_config; ni_set_bits(dev, IO_Bidirection_Pin_Register, ~0, 0); - + unsigned i; + for(i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) + { + ni_writew(devpriv->pfi_output_select_reg[i], M_Offset_PFI_Output_Select(i + 1)); + } /* cs5529 calibration adc */ s = dev->subdevices + 8; if(boardtype.reg_type & ni_reg_67xx_mask) diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index f237fff2..4ce8e1b7 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -46,6 +46,8 @@ #define _bit1 0x0002 #define _bit0 0x0001 +#define NUM_PFI_OUTPUT_SELECT_REGS 6 + /* Registers in the National Instruments DAQ-STC chip */ #define Interrupt_A_Ack_Register 2 @@ -1042,7 +1044,7 @@ static inline int M_Offset_AO_Reference_Attenuation(int channel) }; static inline unsigned M_Offset_PFI_Output_Select(unsigned n) { - if(n < 1 || n > 6) + if(n < 1 || n > NUM_PFI_OUTPUT_SELECT_REGS) { rt_printk("%s: invalid pfi output select register=%i\n", __FUNCTION__, n); return M_Offset_PFI_Output_Select_1; @@ -1296,7 +1298,7 @@ static ni_board ni_boards[]; unsigned short rtsi_trig_direction_reg; \ unsigned short rtsi_trig_a_output_reg; \ unsigned short rtsi_trig_b_output_reg; \ - unsigned short pfi_output_select_reg[6]; \ + unsigned short pfi_output_select_reg[NUM_PFI_OUTPUT_SELECT_REGS]; \ \ unsigned clock_ns; \ unsigned clock_source; \