Changed init of AI_Personal_Register to 0xa420. Could cause problems.
static struct caldac_struct *type1[]={&caldac_mb88341,NULL,NULL};
static struct caldac_struct *type2[]={&caldac_dac8800,&caldac_dac8043,NULL};
+#define MAX_N_CALDACS 12
+
static ni_board ni_boards[]={
{ device_id: 44,
name: "at-mio-16e-1",
#else
win_out((0<<6)|0x0000,AI_Mode_3_Register); /* generate FIFO interrupts on non-empty */
#endif
- /* TIM 5/11/01
- 0xA4A0 causes overrun errors at high speeds. 0xA420 fixes it,
- but I haven't tested to see if it breaks something else. I don't think it would*/
- #ifdef PCIDMA
win_out(0xA420,AI_Personal_Register);
- #else
- win_out(0xa4a0,AI_Personal_Register); /* ? */
- #endif
win_out(0x032e,AI_Output_Control_Register);
win_out(0x0060,AI_Trigger_Select_Register); /* trigger source */
s=dev->subdevices+5;
s->type=COMEDI_SUBD_CALIB;
s->subdev_flags=SDF_WRITEABLE|SDF_INTERNAL;
- caldac_setup(dev,s);
s->insn_read=ni_calib_insn_read;
s->insn_write=ni_calib_insn_write;
+ caldac_setup(dev,s);
/* EEPROM */
s=dev->subdevices+6;
if(diffbits){
int chan;
- s->maxdata_list=kmalloc(sizeof(int)*n_chans,GFP_KERNEL);
+ if(n_chans>=MAX_N_CALDACS){
+ printk("BUG! MAX_N_CALDACS too small\n");
+ }
+ s->maxdata_list=devpriv->caldac_maxdata_list;
chan=0;
for(i=0;i<n_dacs;i++){
for(j=0;j<boardtype.caldac[i]->n_chans;j++){
static struct caldac_struct *type1[]={&caldac_mb88341,NULL,NULL};
static struct caldac_struct *type2[]={&caldac_dac8800,&caldac_dac8043,NULL};
+#define MAX_N_CALDACS 12
+
static ni_board ni_boards[]={
{ device_id: 0x010d,
name: "DAQCard-ai-16xe-50",
static struct caldac_struct *type3[]={&caldac_mb88341,NULL,NULL};
static struct caldac_struct *type4[]={&caldac_mb88341,&caldac_mb88341,&caldac_ad8522};
+#define MAX_N_CALDACS (12+12+1)
+
static ni_board ni_boards[]={
{ device_id: 0x0162, // NI also says 0x1620. typo?
ao_fifo_depth: 16384,
caldac: type4, /* XXX */
},
-
-//TIM 5/14/01
{ device_id: 0x15b0,
name: "pxi-6071e",
n_adchan: 64,
int changain_state; \
unsigned int changain_spec; \
\
+ unsigned int caldac_maxdata_list[MAX_N_CALDACS]; \
unsigned short ao[2]; \
unsigned short caldacs[12]; \
\
unsigned short ao_trigger_select; \
\
unsigned short gpct_mode[2]; \
- unsigned short gpct_command[2]; \
+ unsigned short gpct_command[2]; \
unsigned short gpct_input_select[2]; \
int gpct_cur_operation[2]; \
unsigned short an_trig_etc_reg; \