int chan = CR_CHAN(insn->chanspec);
int range = CR_RANGE(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
// do some initializing
writew(0, priv(dev)->main_iobase + DAC_CONTROL0_REG);
static int ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = priv(dev)->ao_value[CR_CHAN(insn->chanspec)];
return 1;
{
int channel = CR_CHAN(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
/* return immediately if setting hasn't changed, since
* programming these things is slow */
if (priv(dev)->caldac_state[channel] == data[0])
{
unsigned int channel = CR_CHAN(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
data[0] = priv(dev)->caldac_state[channel];
return 1;
{
int channel = CR_CHAN(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
/* return immediately if setting hasn't changed, since
* programming these things is slow */
if (priv(dev)->ad8402_state[channel] == data[0])
{
unsigned int channel = CR_CHAN(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
data[0] = priv(dev)->ad8402_state[channel];
return 1;
static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = read_eeprom(dev, CR_CHAN(insn->chanspec));
return 1;