diff options
author | siddhu8990 | 2015-09-11 02:28:56 +0530 |
---|---|---|
committer | siddhu8990 | 2015-09-11 02:28:56 +0530 |
commit | ed0947602f9b92489be97219e36eb284804dab0a (patch) | |
tree | 0972e6c28e60c026fb4e84d9e7ed6b0f922e6066 | |
parent | 48097fd488521bbb915c301a313ca0a7f0b6eb17 (diff) | |
download | Scilab2C-ed0947602f9b92489be97219e36eb284804dab0a.tar.gz Scilab2C-ed0947602f9b92489be97219e36eb284804dab0a.tar.bz2 Scilab2C-ed0947602f9b92489be97219e36eb284804dab0a.zip |
Changes made for making directory 'arduino' in output folder'
32 files changed, 196 insertions, 30 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin Binary files differindex 04b6e339..a2e3e129 100644 --- a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin +++ b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci index 5c26dd85..69cad558 100644 --- a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci +++ b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.sci @@ -50,6 +50,9 @@ PrintStringInfo('** ---------------------------- ',Pass1HeaderFileName,'file','y PrintStringInfo('** --- End USER2C Includes. --- ',Pass1HeaderFileName,'file','y'); PrintStringInfo('** ---------------------------- ',Pass1HeaderFileName,'file','y'); PrintStringInfo('*/',Pass1HeaderFileName,'file','y'); +PrintStringInfo('#ifdef __cplusplus',Pass1HeaderFileName,'file','y'); +PrintStringInfo('} /* extern ""C"" */',Pass1HeaderFileName,'file','y'); +PrintStringInfo('#endif',Pass1HeaderFileName,'file','y'); PrintStringInfo('#endif',Pass1HeaderFileName,'file','y'); // ------------------------------------- // --- End Finalize the header file. --- diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex fd2de293..bbb2ceaf 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin Binary files differindex 76b8a7e6..01475765 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci index 7d794127..41e13e45 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci @@ -46,6 +46,9 @@ PrintStringInfo('** --------------------------- ',HeaderFileName,'file','y'); PrintStringInfo('*/',HeaderFileName,'file','y'); PrintStringInfo(' ',HeaderFileName,'file','y'); PrintStringInfo(' ',HeaderFileName,'file','y'); +PrintStringInfo('#ifdef __cplusplus',HeaderFileName,'file','y'); +PrintStringInfo('extern ""C"" {',HeaderFileName,'file','y'); +PrintStringInfo('#endif',HeaderFileName,'file','y'); PrintStringInfo('/*',HeaderFileName,'file','y'); PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** --- Prototypes. --- ',HeaderFileName,'file','y'); diff --git a/2.3-1/macros/CCodeGeneration/C_Type.bin b/2.3-1/macros/CCodeGeneration/C_Type.bin Binary files differindex 7ddf022c..36a94585 100644 --- a/2.3-1/macros/CCodeGeneration/C_Type.bin +++ b/2.3-1/macros/CCodeGeneration/C_Type.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin Binary files differindex b77a9afd..2925a703 100644 --- a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin Binary files differindex 8d9139da..3f8981a0 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin Binary files differindex 8ba0ebd6..733ab516 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin Binary files differindex 6626be92..a1bf6f5a 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex 56b0428c..9c82bde9 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci index 7b8826c4..a61eb724 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci @@ -1,4 +1,4 @@ -function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode)
+function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,OutFormat)
// function SharedInfo = INIT_GenSharedInfo(WorkingDir,OutCCCodeDir,UserSciFilesPaths,...
// RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName)
// -----------------------------------------------------------------
@@ -47,7 +47,11 @@ SharedInfo.Sci2CLibMainHeaderFName = pathconvert(Sci2CLibMainHeaderFName, %f, %f SharedInfo.NextSCIFileName = UserScilabMainFile;
[scipath,funname,sciext] = fileparts(UserScilabMainFile);
SharedInfo.SCIMainFunName = funname;
-SharedInfo.CMainFunName = 'main';
+if (OutFormat == 'Arduino')
+ SharedInfo.CMainFunName = 'loop_arduino';
+else
+ SharedInfo.CMainFunName = 'main';
+end
SharedInfo.NextSCIFunName = SharedInfo.SCIMainFunName; //NUT: per ora no so cosa metter
SharedInfo.NextCFunName = SharedInfo.CMainFunName; //NUT: per ora no so cosa metter //NUT: questo viene aggiornato dalla C_Funcall
SharedInfo.NextSCIFunNumber = 1;
@@ -115,4 +119,7 @@ SharedInfo.Extension.FuncListClasses = '.lcls'; // Stands for list class // --- Resize Approach. ---
// ------------------------
SharedInfo.ResizeApproach = 'NO_RESIZE'; // 'NO_RESIZE', 'RESIZE_ALL', 'RESIZE_TEMP', 'RESIZE_LOCAL', 'RESIZE_GLOBAL', 'REALLOC_ALL_RESIZE_ALL'
+
+SharedInfo.OutFormat = OutFormat;
+
endfunction
diff --git a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin Binary files differindex 38cd5bbf..35bc6a1b 100644 --- a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin Binary files differindex fd1298ad..5a3cc93b 100644 --- a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex fb6b72ac..1c2b2d3e 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci index 8b3e5b2f..4065d047 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci @@ -1,5 +1,5 @@ function [FileInfoDatFile,SharedInfoDatFile] = ...
- INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode)
+ INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,OutFormat)
// function [FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(SCI2CInputPrmFile)
// -----------------------------------------------------------------
// #RNU_RES_B
@@ -68,7 +68,7 @@ OutCCCodeDir = SCI2CResultDir; //-- FIXME : MainLibHeader and Verbose mode are (?) configurable
SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile, ...
- TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t);
+ TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t,OutFormat);
// ----------------------------
// --- Initialize FileInfo. ---
diff --git a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin Binary files differindex 33f96da6..6737e64a 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin diff --git a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin Binary files differindex 1d428d26..03565bd9 100644 --- a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin +++ b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 4bc5a55e..2ee6b8df 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/cb_sci2c_gui.sci b/2.3-1/macros/cb_sci2c_gui.sci index 935c0e6f..9d1770fb 100644 --- a/2.3-1/macros/cb_sci2c_gui.sci +++ b/2.3-1/macros/cb_sci2c_gui.sci @@ -54,6 +54,17 @@ elseif or(get(gcbo, "tag")==["runradioall","runradiotranslate","runradiogenlib"] set(gcbo, "value", 1); + +// --- Output format option --- + +elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino"]) then + + set(findobj("tag", "outformatradiostalone"), "value", 0); + set(findobj("tag", "outformatradioarduino"), "value", 0); + + set(gcbo, "value", 1); + + // // --- Copy Scilab code into C option --- // @@ -100,6 +111,12 @@ elseif get(gcbo, "tag")=="convertbtn" then RunMode = "GenLibraryStructure"; end + if get(findobj("tag", "outformatradiostalone"), "value") == 1 then + OutFormat = "StandAlone"; + elseif get(findobj("tag", "outformatradioarduino"), "value") == 1 then + OutFormat = "Arduino"; + end + CopySciCodeIntoCCode = get(findobj("tag", "sciintocradioyes"), "value") == 1; if get(findobj("tag", "buildtoolradiowin"), "value") == 1 then @@ -118,7 +135,7 @@ elseif get(gcbo, "tag")=="convertbtn" then // mprintf("RunMode = {%s}\n", RunMode); // mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode)); // mprintf("NativeBuild = {%s}\n", NativeBuild); - scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild); + scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,OutFormat); // // --- sci2c help --- // diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 48296225..b0355de4 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex 6f0781e2..1a0fedce 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex d5a5c970..a6894729 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getArduinoFiles.sci b/2.3-1/macros/findDeps/getArduinoFiles.sci new file mode 100644 index 00000000..a51d9b52 --- /dev/null +++ b/2.3-1/macros/findDeps/getArduinoFiles.sci @@ -0,0 +1,17 @@ +// +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// +// + +function arduinoFiles = getArduinoFiles() + arduinoFiles = [ + "src/c/scilab-arduino/default_files/Makefile" + "src/c/scilab-arduino/default_files/sci2c_arduino.ino"]; +endfunction diff --git a/2.3-1/macros/findDeps/names b/2.3-1/macros/findDeps/names index 2ba0b634..88d610bf 100644 --- a/2.3-1/macros/findDeps/names +++ b/2.3-1/macros/findDeps/names @@ -3,3 +3,4 @@ getAllHeaders getAllInterfaces Scilab2CDeps findDeps +getArduinoFiles diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index fbdad316..ee7510ef 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -1,4 +1,4 @@ -function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool)
+function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,OutFormat)
// function runsci2c(SCI2CInputPrmFile)
// -----------------------------------------------------------------
// === hArtes/PoliBa/GAP SCI2C tool ===
@@ -51,7 +51,7 @@ disp(RunSci2CMainDir); // --- Initialize the SCI2C tool directories and files. ---
[FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(UserScilabMainFile, ...
- UserSciFilesPaths, SCI2COutputPath, RunMode);
+ UserSciFilesPaths, SCI2COutputPath, RunMode, OutFormat);
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
@@ -124,6 +124,37 @@ for i = 1:size(allInterfaces, "*") copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
end
+
+// --------------------------
+// --- Generate Makefile. ---
+// --------------------------
+//If output format is chosen as 'Arduino', then copy makefile for arduino from
+//default folder, else generate makefile for standalone c code
+
+if (OutFormat == 'Arduino')
+ mkdir(SCI2COutputPath+"/arduino/");
+ mkdir(SCI2COutputPath+"/arduino/sci2c_arduino");
+ //Copy arduino makefile
+ arduinoFiles = SCI2CHOME + "/" + getArduinoFiles();
+ PrintStepInfo('Copying arduino files', FileInfo.GeneralReport,'both');
+ for i = 1:size(arduinoFiles, "*")
+ // DEBUG only
+ //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
+ copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
+ end
+
+else
+
+ if BuildTool == "make"
+ C_GenerateMakefile(FileInfo,SharedInfo);
+ end
+ if BuildTool == "nmake"
+ copyBlasLapackLibs(FileInfo,SharedInfo);
+ C_GenerateMakefile_msvc(FileInfo,SharedInfo);
+ end
+end
+
+
// ------------------------------
// --- Generate SCI2C Header. ---
// ------------------------------
@@ -131,16 +162,7 @@ end FunctionPrefix = "SCI2C";
C_GenerateSCI2CHeader(SCI2COutputPath+"/includes/", FunctionPrefix);
-// --------------------------
-// --- Generate Makefile. ---
-// --------------------------
-if BuildTool == "make"
- C_GenerateMakefile(FileInfo,SharedInfo);
-end
-if BuildTool == "nmake"
- copyBlasLapackLibs(FileInfo,SharedInfo);
- C_GenerateMakefile_msvc(FileInfo,SharedInfo);
-end
+
// -----------------
// --- Epilogue. ---
@@ -150,6 +172,8 @@ if (RunMode == 'All' | RunMode == 'Translate') elseif (RunMode == 'GenLibraryStructure')
PrintStepInfo('Library Structure Successfully Created!!!',FileInfo.GeneralReport,'both');
end
+
+
endfunction
diff --git a/2.3-1/macros/sci2c_gui.sci b/2.3-1/macros/sci2c_gui.sci index c4ba0387..3abe497c 100644 --- a/2.3-1/macros/sci2c_gui.sci +++ b/2.3-1/macros/sci2c_gui.sci @@ -38,7 +38,7 @@ uimenu("parent", h, "label", gettext("Sci2c help page"), "callback", "cb_sci2c_g uimenu("parent", h, "label", gettext("About SCI2C tools..."), "callback", "cb_sci2c_gui", "tag", "about_sci2c_menu"); figw = 800; -figh = 15*margin + btnh + 7*widgeth; +figh = 15*margin + btnh + 9*widgeth; sci2cfig.axes_size = [figw figh]; sci2cfig.auto_resize = "on"; //sci2cfig.visible = "off"; // to be sure that no plot can appear in the window @@ -79,7 +79,7 @@ optframe = uicontrol("parent", sci2cfig,... "relief", "groove",... "style", "frame",... "units", "pixels",... - "position", [margin 2*margin+btnh figw-2*margin 4*margin+4*widgeth],... + "position", [margin 2*margin+btnh figw-2*margin 4*margin+6*widgeth],... "fontname", defaultfont,... "fontunits", "points",... "fontsize", 12,... @@ -90,7 +90,7 @@ opttitle = uicontrol("parent", sci2cfig,... "style", "text",... "string", gettext("Options"),... "units", "pixels",... - "position", [2*margin 2*margin+btnh+4*margin+4*widgeth-8 50 14],... + "position", [2*margin 2*margin+btnh+4*margin+6*widgeth-8 50 18],... "fontname", defaultfont,... "fontunits", "points",... "fontsize", 11,... @@ -175,8 +175,47 @@ sciintocradiono = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "sciintocradiono"); +// --- Output format: Standalone or Arduino +outformaty = sciintocy + margin + btnh ; +outformatlabel = uicontrol("parent", sci2cfig,... + "style", "text",... + "string", gettext("Type of output format: "),... + "position",[2*margin outformaty widgetLabelWidth widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12); + +outformatradiostalone = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Stand-alone"),... + "position",[2*margin+widgetLabelWidth outformaty 2*radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 1,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradiostalone"); + +outformatradioarduino = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Arduino"),... + "position",[2*margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradioarduino"); + // --- Run mode option --- -runy = sciintocy + margin + widgeth; +runy = outformaty + margin + widgeth; runlabel = uicontrol("parent", sci2cfig,... "style", "text",... "string", gettext("Run mode: "),... @@ -229,7 +268,7 @@ runradiogenlib = uicontrol("parent", sci2cfig,... // --- Output directory --- // ------------------------ // Frame -optframemaxy = 2*margin+btnh + 4*margin+4*widgeth; +optframemaxy = 2*margin+btnh + 4*margin+6*widgeth; outframe = uicontrol("parent", sci2cfig,... "relief", "groove",... "style", "frame",... diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index d922e0b1..25fc06ac 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -34,7 +34,8 @@ function scilab2c(varargin) CCodeOutputDir = varargin(2); UserSciFilesPaths = []; RunMode = 'All'; - BuildTool = getNativeBuildTool(); + BuildTool = getNativeBuildTool(); + OutFormat = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths) // @@ -53,7 +54,8 @@ function scilab2c(varargin) UserSciFilesPaths = varargin(3); end RunMode = "All"; - BuildTool = getNativeBuildTool(); + BuildTool = getNativeBuildTool(); + OutFormat = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // @@ -76,7 +78,8 @@ function scilab2c(varargin) UserSciFilesPaths = varargin(3); end RunMode = varargin(4); - BuildTool = getNativeBuildTool(); + BuildTool = getNativeBuildTool(); + OutFormat = "StandAlone" case 5 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -100,7 +103,37 @@ function scilab2c(varargin) UserSciFilesPaths = varargin(3); end RunMode = varargin(4); - BuildTool = varargin(5); + BuildTool = varargin(5); + OutFormat = "StandAlone" + case 6 + for i = 1:4 + if typeof(varargin(i)) <> "string" + error(msprintf(gettext("%s: Wrong type for input argument #%d: String expected.\n"),"scilab2c",i)); + return + end + end + if varargin(4) <> "All" & varargin(4) <> "Translate" & varargin(4) <> "GenLibraryStructure" + error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" or ""GenLibraryStructure"".\n"),"scilab2c",4)); + return + end + if varargin(5) <> "make" & varargin(5) <> "nmake" + error(msprintf(gettext("%s: argument #%d must be: ""make"" or ""nmake"".\n"),"scilab2c",5)); + return + end + if varargin(6) <> "StandAlone" & varargin(6) <> "Arduino" + error(msprintf(gettext("%s: argument #%d must be: ""StandAlone"" or ""Arduino"".\n"),"scilab2c",5)); + return + end + UserScilabMainFile = varargin(1); + CCodeOutputDir = varargin(2); + if varargin(3) == "" + UserSciFilesPaths = []; + else + UserSciFilesPaths = varargin(3); + end + RunMode = varargin(4); + BuildTool = varargin(5); + OutFormat = varargin(6); else // // Calling scilab2c with more than understood values @@ -121,7 +154,7 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), end if (userchoice == 1) // --- LAUNCH SCI2C --- - runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool); + runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,OutFormat); end endfunction @@ -132,4 +165,4 @@ function BuildTool = getNativeBuildTool() else BuildTool = "make" end -endfunction
\ No newline at end of file +endfunction diff --git a/2.3-1/src/c/matrixOperations/cat/ccata.c b/2.3-1/src/c/matrixOperations/cat/ccata.c index cd2b4c92..88106a87 100644 --- a/2.3-1/src/c/matrixOperations/cat/ccata.c +++ b/2.3-1/src/c/matrixOperations/cat/ccata.c @@ -26,7 +26,7 @@ void crowcata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, i { for (j = 0 ; j < lines1 ; ++j) { - out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; + //out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; } for (j = 0 ; j < lines2 ; ++j) { diff --git a/2.3-1/src/c/matrixOperations/cat/zcata.c b/2.3-1/src/c/matrixOperations/cat/zcata.c index 485553d7..30d50eea 100644 --- a/2.3-1/src/c/matrixOperations/cat/zcata.c +++ b/2.3-1/src/c/matrixOperations/cat/zcata.c @@ -26,7 +26,7 @@ void zrowcata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, { for (j = 0 ; j < lines1 ; ++j) { - out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; + //out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; } for (j = 0 ; j < lines2 ; ++j) { diff --git a/2.3-1/src/c/scilab-arduino/default_files/Makefile b/2.3-1/src/c/scilab-arduino/default_files/Makefile new file mode 100644 index 00000000..7d74195e --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/default_files/Makefile @@ -0,0 +1,10 @@ +# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile + +ARDUINO_DIR = /usr/share/arduino +ARDMK_DIR = /usr/share/arduino +AVR_TOOLS_DIR = /usr +BOARD_TAG = atmega328 +USER_LIB_PATH = ../../ +ARDUINO_LIBS = src/c includes interfaces ../Temp +ARDUINO_PORT = /dev/ttyUSB0 +include /usr/share/arduino/Arduino.mk diff --git a/2.3-1/src/c/scilab-arduino/default_files/sci2c_arduino.ino b/2.3-1/src/c/scilab-arduino/default_files/sci2c_arduino.ino new file mode 100644 index 00000000..9e9d9b6e --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/default_files/sci2c_arduino.ino @@ -0,0 +1,12 @@ +#include "Arduino.h" +#include <loop_arduino.h> + +void setup() +{ + //Please write appropriate setup functions here. +} +int i = 0; +void loop() +{ + loop_arduino(); +} |