File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 3232 isOutput = false
3333 end
3434
35+ properties (Access = protected )
36+ InSetup = false ;
37+ end
38+
3539 properties (Abstract , Nontunable , Hidden )
3640 Timeout
3741 kernelBuffersCount
8185 end
8286
8387 % Connects to device temporarily and fetches the channel names
88+ obj.InSetup = true ;
8489 obj .setup();
8590 release(obj );
91+ obj.InSetup = false ;
8692 end
8793
8894 function set .SamplesPerFrame(obj , value )
@@ -138,6 +144,14 @@ function setupInit(obj)
138144 end
139145
140146 obj .set_channel_names();
147+ if obj .InSetup
148+ obj.EnabledChannels = 1 : length(obj .channel_names );
149+ else
150+ % This looks like an HDL bug, but all channels need to be
151+ % enabled or they will timeout or not correctly be configured
152+ assert(length(obj .EnabledChannels )==length(obj .channel_names ), ...
153+ ' All channels must be enabled for platform' );
154+ end
141155
142156 end
143157
@@ -147,7 +161,7 @@ function set_channel_names(obj)
147161 chanCount = obj .iio_device_get_channels_count(phydev );
148162 for c = 1 : chanCount
149163 chanPtr = obj .iio_device_get_channel(phydev , c - 1 );
150- obj.channel_names{end + 1 } = obj .iio_channel_get_name (chanPtr );
164+ obj.channel_names{end + 1 } = obj .iio_channel_get_id (chanPtr );
151165 end
152166 end
153167
Original file line number Diff line number Diff line change 1515
1616% Only a select few channel groupings yield sensible outputs. Refer to the
1717% Limitations section in the documentation for more details
18- rx.EnabledChannels = [1 ];
18+ rx.EnabledChannels = [1 , 2 ];
1919
2020% Capture data
2121data = rx();
You can’t perform that action at this time.
0 commit comments