pre-release 1.02
This commit is contained in:
@@ -4,10 +4,11 @@ function res = mexing(compile_mode)
|
||||
Ts = 0.00001;
|
||||
|
||||
if compile_mode == 1
|
||||
delete("*.mexw64")
|
||||
delete("*.mexw64.pdb")
|
||||
delete(".\MCU_Wrapper\Outputs\*.*");
|
||||
delete('*.mexw64')
|
||||
delete('*.mexw64.pdb')
|
||||
delete([mcuPath.get('wrapperPath'), '\Outputs\*.*']);
|
||||
set_param(gcb, 'consoleOutput', '');
|
||||
compiler.updateRunBat();
|
||||
% Дефайны
|
||||
definesUserArg = parseDefinesMaskText();
|
||||
definesWrapperConfigArg = buildWrapperDefinesString();
|
||||
@@ -31,7 +32,8 @@ function res = mexing(compile_mode)
|
||||
Name = mcuMask.get_name();
|
||||
|
||||
% Вызов батника с двумя параметрами: includes и code
|
||||
cmd = sprintf('.\\MCU_Wrapper\\run_mex.bat %s "%s" "%s" "%s" "%s" %s %s', Name, includesArg, codeArg, definesUserArg, definesConfigArg, modeArg, echoArg);
|
||||
run_bat_mex_path = fullfile(mcuPath.get('wrapperPath'), 'run_mex.bat');
|
||||
cmd = sprintf('%s %s "%s" "%s" "%s" "%s" %s %s', run_bat_mex_path, Name, includesArg, codeArg, definesUserArg, definesConfigArg, modeArg, echoArg);
|
||||
|
||||
if mcuMask.read_checkbox('extConsol')
|
||||
cmdout = runBatAndShowOutput(cmd);
|
||||
@@ -64,10 +66,10 @@ function res = mexing(compile_mode)
|
||||
beep
|
||||
else
|
||||
blockPath = gcb;
|
||||
config = periphConfig.read_config(blockPath);
|
||||
config = periphConfig.update_config(blockPath, config);
|
||||
periphConfig.write_config(config);
|
||||
periphConfig.update(blockPath, config);
|
||||
config = configJs.read(blockPath);
|
||||
config = configJs.update(blockPath, config);
|
||||
configJs.write(config);
|
||||
periphConfig.updateMask(blockPath, config);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -200,6 +202,8 @@ function definesWrapperArg = buildConfigDefinesString()
|
||||
definesWrapperArg = addDefineByParam(definesWrapperArg, paramName, 0);
|
||||
case 'edit'
|
||||
definesWrapperArg = addDefineByParam(definesWrapperArg, paramName, 1);
|
||||
case 'popup'
|
||||
definesWrapperArg = addDefineByParam(definesWrapperArg, paramName, 0);
|
||||
otherwise
|
||||
% Необрабатываемые типы
|
||||
end
|
||||
@@ -228,7 +232,21 @@ function definesWrapperArg = addDefineByParam(definesWrapperArg, paramName, val_
|
||||
end
|
||||
|
||||
% Берём alias из маски
|
||||
alias = param.Alias;
|
||||
val = '';
|
||||
if ~strcmp(param.Type, 'popup')
|
||||
def_name = param.Alias;
|
||||
else
|
||||
if strcmp(param.Alias, '')
|
||||
def_name = param.Value;
|
||||
else
|
||||
def_name = param.Alias;
|
||||
val = param.Value;
|
||||
end
|
||||
end
|
||||
|
||||
if strcmp(def_name, '')
|
||||
return;
|
||||
end
|
||||
|
||||
if val_define ~= 0
|
||||
% Значение параметра
|
||||
@@ -238,14 +256,16 @@ function definesWrapperArg = addDefineByParam(definesWrapperArg, paramName, val_
|
||||
val = num2str(val); % Преобразуем результат в строку
|
||||
end
|
||||
% Формируем define с кавычками и значением
|
||||
newDefine = ['-D"' alias '__EQ__' val '"'];
|
||||
else
|
||||
newDefine = ['-D"' def_name '__EQ__' val '"'];
|
||||
elseif ~strcmp(param.Type, 'popup')
|
||||
if mcuMask.read_checkbox(paramName)
|
||||
% Формируем define с кавычками без значения
|
||||
newDefine = ['-D"' alias '"'];
|
||||
newDefine = ['-D"' def_name '"'];
|
||||
else
|
||||
newDefine = '';
|
||||
end
|
||||
else
|
||||
newDefine = ['-D"' def_name '__EQ__' val '"'];
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user