diff options
author | siddhu8990 | 2015-09-28 14:10:44 +0530 |
---|---|---|
committer | siddhu8990 | 2015-09-28 14:10:44 +0530 |
commit | 3bcc8ce62560f36eaaab0e064b169b0118f354f3 (patch) | |
tree | 3b02338a8791e887b955b327b6ed987f14346921 | |
parent | 02d130cbece220ee2dafeb8d2236a51806e5fac8 (diff) | |
download | Scilab2C-3bcc8ce62560f36eaaab0e064b169b0118f354f3.tar.gz Scilab2C-3bcc8ce62560f36eaaab0e064b169b0118f354f3.tar.bz2 Scilab2C-3bcc8ce62560f36eaaab0e064b169b0118f354f3.zip |
Extension compatible with both - standalone and Arduino outputs.
25 files changed, 51 insertions, 14 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin Binary files differindex 133956eb..e262750a 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_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex d4164e6b..eb01ef65 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_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci index e2fe6036..320d8035 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -59,8 +59,10 @@ PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y', PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y'); // Sources +//Check the output format selected and insert files according to it +outformat = SharedInfo.OutFormat; PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y'); -allSources = getAllSources(); +allSources = getAllSources(outformat); nbSources = size(allSources); for i = 1:(nbSources(1) - 1) [tmppath,tmpfile,tmpext] = fileparts(allSources(i)); diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin Binary files differindex 0673399a..45bb3564 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_Type.bin b/2.3-1/macros/CCodeGeneration/C_Type.bin Binary files differindex 424c6155..00c10704 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 e180f6e0..5c17670b 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 b0cff95b..6220b291 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 e5a9ae29..dc4c3fe9 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 de7d66e9..2df9a4fd 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 28e3e322..ce14906c 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_LoadLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin Binary files differindex 65cd4c0e..0a48d061 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 4982a1ee..fc036951 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 b3a3aaaa..22ac0148 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_SharedInfoEqual.bin b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin Binary files differindex b0f6e77c..55ef7bbc 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 93114c67..60555762 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 142bfd78..4a06ba27 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 3cbeb650..e9992fd4 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/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 9ae5b257..e152514b 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -10,8 +10,10 @@ // // -function allHeaders = getAllHeaders() - allHeaders = [ +function allHeaders = getAllHeaders(OutFormat) + + //Header files common to all types of output format. + Standalone_headers = [ "includes/blas.h" "includes/lapack.h" "includes/constant.h" @@ -124,10 +126,20 @@ function allHeaders = getAllHeaders() "src/c/signalProcessing/includes/dynlib_signalprocessing.h" "src/c/signalProcessing/includes/crossCorr.h" "src/c/implicitList/dynlib_implicitlist.h" - "src/c/implicitList/implicitList.h" + "src/c/implicitList/implicitList.h"]; + + //Header files required for "Arduino" output + Arduino_headers = [ "src/c/scilab-arduino/includes/cmd_digital_out.h" "src/c/scilab-arduino/includes/cmd_digital_in.h" "src/c/scilab-arduino/includes/cmd_analog_out.h" "src/c/scilab-arduino/includes/cmd_analog_in.h" "src/c/scilab-arduino/includes/sleep.h"]; + + if OutFormat == "StandAlone" + allHeaders = Standalone_headers; + elseif OutFormat == "Arduino" + allHeaders = cat(1,Standalone_headers, Arduino_headers); + end + endfunction diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex c01712f7..c607ea19 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/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index b32f9d5f..b32bb652 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -10,8 +10,9 @@ // // -function allInterfaces = getAllInterfaces() - allInterfaces = [ +function allInterfaces = getAllInterfaces(OutFormat) + //Interface files common to all types of output format + Standalone_interfaces = [ "src/c/auxiliaryFunctions/interfaces/int_rand.h" "src/c/auxiliaryFunctions/interfaces/int_sign.h" "src/c/auxiliaryFunctions/interfaces/int_size.h" @@ -118,10 +119,20 @@ function allInterfaces = getAllInterfaces() "src/c/signalProcessing/interfaces/int_fftshift.h" "src/c/signalProcessing/interfaces/int_fft.h" "src/c/signalProcessing/interfaces/int_lev.h" - "src/c/implicitList/int_OpColon.h" + "src/c/implicitList/int_OpColon.h"]; + + //Interface files required for "Arduino" output + Arduino_interfaces = [ "src/c/scilab-arduino/interfaces/int_cmd_digital_out.h" "src/c/scilab-arduino/interfaces/int_cmd_digital_in.h" "src/c/scilab-arduino/interfaces/int_cmd_analog_out.h" "src/c/scilab-arduino/interfaces/int_cmd_analog_in.h" "src/c/scilab-arduino/interfaces/int_sleep.h"]; + + if OutFormat == "StandAlone" + allInterfaces = Standalone_interfaces; + elseif OutFormat == "Arduino" + allInterfaces = cat(1,Standalone_interfaces, Arduino_interfaces); + end + endfunction diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex bf26b3ba..1d698a0e 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/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index c33346f5..356ba38e 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -10,8 +10,9 @@ // // -function allSources = getAllSources() - allSources = [ "src/c/auxiliaryFunctions/abs/sabsa.c" +function allSources = getAllSources(OutFormat) + //Files common to types of output format + Standalone_files = [ "src/c/auxiliaryFunctions/abs/sabsa.c" "src/c/auxiliaryFunctions/abs/sabss.c" "src/c/auxiliaryFunctions/abs/zabsa.c" "src/c/auxiliaryFunctions/abs/zabss.c" @@ -814,10 +815,18 @@ function allSources = getAllSources() "src/c/implicitList/zimplicitLists.c" "src/c/implicitList/dimplicitLists.c" "src/c/implicitList/cimplicitLists.c" - "src/c/implicitList/simplicitLists.c" - "src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c" + "src/c/implicitList/simplicitLists.c" ]; + + //Files to be inserted only if output format selected is 'Arduino'. + Arduino_files = ["src/c/scilab-arduino/cmd_digital_out/u8cmd_digital_outs.c" "src/c/scilab-arduino/cmd_digital_in/u8cmd_digital_ins.c" "src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c" "src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c" "src/c/scilab-arduino/sleep/u16sleeps.c"]; + if OutFormat == "StandAlone" + allSources = Standalone_files; + elseif OutFormat == "Arduino" + allSources = cat(1,Standalone_files, Arduino_files); + end + endfunction diff --git a/2.3-1/macros/findDeps/getArduinoFiles.bin b/2.3-1/macros/findDeps/getArduinoFiles.bin Binary files differindex f63160ef..3becbac7 100644 --- a/2.3-1/macros/findDeps/getArduinoFiles.bin +++ b/2.3-1/macros/findDeps/getArduinoFiles.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index ee7510ef..880cc9d8 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -91,9 +91,10 @@ end // --- Copy library files. ---
// ---------------------------
global SCI2CHOME
-allSources = SCI2CHOME + "/" + getAllSources();
-allHeaders = SCI2CHOME + "/" +getAllHeaders();
-allInterfaces = SCI2CHOME + "/" + getAllInterfaces();
+
+allSources = SCI2CHOME + "/" + getAllSources(OutFormat);
+allHeaders = SCI2CHOME + "/" +getAllHeaders(OutFormat);
+allInterfaces = SCI2CHOME + "/" + getAllInterfaces(OutFormat);
mkdir(SCI2COutputPath+"/src/");
mkdir(SCI2COutputPath+"/src/c/");
diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index 25fc06ac..1d4675e3 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -143,7 +143,9 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), // --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! --- + if OutFormat == "StandAlone" runscicode(UserScilabMainFile, UserSciFilesPaths); + end // --- ASK USER FOR CONTINUATION. --- // Do not open confirmation box if we are not in STD mode. |