Commit c5a96aea authored by Pavel Vainerman's avatar Pavel Vainerman

(IOControl): Исправил конфигурирование subdev в связи с решением баги

(eterbug #7379)
parent e3a05c4d
...@@ -134,23 +134,26 @@ void ComediInterface::configureChannel( int subdev, int channel, ChannelType t, ...@@ -134,23 +134,26 @@ void ComediInterface::configureChannel( int subdev, int channel, ChannelType t,
throw Exception(err.str()); throw Exception(err.str());
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void ComediInterface::configureSubdev( int subdev, SubdevType t ) void ComediInterface::configureSubdev( int subdev, SubdevType type )
throw(UniSetTypes::Exception) throw(UniSetTypes::Exception)
{ {
lsampl_t cmd = 102; lsampl_t data[2];
comedi_insn insn; comedi_insn insn;
memset(&insn,0,sizeof(insn)); memset(&insn,0,sizeof(insn));
insn.insn = INSN_CONFIG; insn.insn = INSN_CONFIG;
insn.n = 1; insn.n = 2;
insn.data = &cmd; insn.data = data;
insn.unused[0] = t;
insn.subdev = subdev; insn.subdev = subdev;
insn.chanspec = 0; insn.chanspec = 0;
data[0] = 102;
data[1] = type;
if( comedi_do_insn(card,&insn) < 0 ) if( comedi_do_insn(card,&insn) < 0 )
{ {
ostringstream err; ostringstream err;
err << "(ComediInterface:configureSubdev): can`t configure subdev " err << "(ComediInterface:configureSubdev): can`t configure subdev "
<< " subdev=" << subdev << " type=" << t; << " subdev=" << subdev << " type=" << type;
throw Exception(err.str()); throw Exception(err.str());
} }
} }
......
...@@ -1671,7 +1671,7 @@ void IOControl::buildCardsList() ...@@ -1671,7 +1671,7 @@ void IOControl::buildCardsList()
} }
unideb[Debug::INFO] << myname << "(buildCardsList): init subdev" << i << " " << it.getProp(s.str()) << endl; unideb[Debug::INFO] << myname << "(buildCardsList): init subdev" << i << " " << it.getProp(s.str()) << endl;
//cards[lastnum]->configureSubdev(i-1,st); cards[lastnum]->configureSubdev(i-1,st);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment