Update FIR update to handle errors and remove unnecessary rate update
Signed-off-by: Travis Collins <travis.collins@analog.com>master
parent
f8c43e1ca1
commit
86ddac67f1
|
@ -330,17 +330,22 @@ classdef iio_sys_obj_matlab
|
|||
|
||||
ret=varargout;
|
||||
end
|
||||
|
||||
|
||||
function ret = writeFirData(obj, fir_data_file)
|
||||
fir_data_str = fileread(fir_data_file);
|
||||
% Force sample rate to a value not requiring a FIR to prevent loading errors
|
||||
r0 = writeAttributeString(obj.libiio_ctrl_dev, 'in_voltage_sampling_frequency', '3000000');
|
||||
r1 = writeAttributeString(obj.libiio_ctrl_dev, 'in_out_voltage_filter_fir_en', '0');
|
||||
r2 = writeAttributeString(obj.libiio_ctrl_dev, 'filter_fir_config', fir_data_str);
|
||||
r3 = writeAttributeString(obj.libiio_ctrl_dev, 'in_out_voltage_filter_fir_en', '1');
|
||||
if any([r0, r1, r2, r3]<0)
|
||||
ret = -1;
|
||||
ret = writeAttributeString(obj.libiio_ctrl_dev, 'in_out_voltage_filter_fir_en', '0');
|
||||
if ret<0
|
||||
return;
|
||||
end
|
||||
ret = writeAttributeString(obj.libiio_ctrl_dev, 'filter_fir_config', fir_data_str);
|
||||
if ret<0
|
||||
return;
|
||||
end
|
||||
ret = writeAttributeString(obj.libiio_ctrl_dev, 'in_out_voltage_filter_fir_en', '1');
|
||||
if ret<0
|
||||
return;
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue