Skip to content
This repository was archived by the owner on Jan 17, 2019. It is now read-only.

Commit 7372f1e

Browse files
committed
EQ tune: Update m4 format EQ filter coefficients syntax
This patch updates the export format to currently used format in topology. It adds also possibility to pass text comment into line above the bytes from EQ design script. The date is appended automatically after comment. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 8a56694 commit 7372f1e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tune/eq/eq_tplg_write.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function eq_tplg_write(fn, blob8, eqtype)
1+
function eq_tplg_write(fn, blob8, eqtype, comment)
22

33
%%
44
% Copyright (c) 2018, Intel Corporation
@@ -30,6 +30,10 @@ function eq_tplg_write(fn, blob8, eqtype)
3030
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
3131
%
3232

33+
if nargin < 4
34+
comment = 'Exported EQ';
35+
end
36+
3337
%% Pad blob length to multiple of four bytes
3438
n_orig = length(blob8);
3539
n_new = ceil(n_orig/4)*4;
@@ -39,8 +43,8 @@ function eq_tplg_write(fn, blob8, eqtype)
3943
%% Write blob
4044
fh = fopen(fn, 'w');
4145
nl = 8;
42-
fprintf(fh, '`SectionData."''N_EQ_%s($1)`_data_bytes" {''\n', ...
43-
upper(eqtype));
46+
fprintf(fh, '# %s %s\n', comment, date());
47+
fprintf(fh, 'CONTROLBYTES_PRIV(EQ%s_priv,\n', upper(eqtype));
4448
fprintf(fh, '` bytes "');
4549
for i = 1:nl:n_new
4650
if i > 1
@@ -57,7 +61,7 @@ function eq_tplg_write(fn, blob8, eqtype)
5761
end
5862
fprintf(fh, '''\n');
5963
end
60-
fprintf(fh, '`}''\n');
64+
fprintf(fh, ')\n');
6165
fclose(fh);
6266

6367
end

0 commit comments

Comments
 (0)