Merge pull request #91 from singalsu/fix_eq_m4_export

EQ tune: Update m4 format EQ filter coefficients syntax
This commit is contained in:
Liam Girdwood 2018-10-04 17:38:21 +01:00 committed by GitHub
commit 2d7a933aa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
function eq_tplg_write(fn, blob8, eqtype)
function eq_tplg_write(fn, blob8, eqtype, comment)
%%
% Copyright (c) 2018, Intel Corporation
@ -30,6 +30,10 @@ function eq_tplg_write(fn, blob8, eqtype)
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
%
if nargin < 4
comment = 'Exported EQ';
end
%% Pad blob length to multiple of four bytes
n_orig = length(blob8);
n_new = ceil(n_orig/4)*4;
@ -39,8 +43,8 @@ blob8_new(1:n_orig) = blob8;
%% Write blob
fh = fopen(fn, 'w');
nl = 8;
fprintf(fh, '`SectionData."''N_EQ_%s($1)`_data_bytes" {''\n', ...
upper(eqtype));
fprintf(fh, '# %s %s\n', comment, date());
fprintf(fh, 'CONTROLBYTES_PRIV(EQ%s_priv,\n', upper(eqtype));
fprintf(fh, '` bytes "');
for i = 1:nl:n_new
if i > 1
@ -57,7 +61,7 @@ for i = 1:nl:n_new
end
fprintf(fh, '''\n');
end
fprintf(fh, '`}''\n');
fprintf(fh, ')\n');
fclose(fh);
end