From 369c257b9ae0320621b43ca75b38ff66cc13f37b Mon Sep 17 00:00:00 2001 From: yash1112 Date: Mon, 19 Jun 2017 05:40:46 +0530 Subject: 1.3 new scilab-arduino functions added2. all functions have been tested on hardware 3. 5 i2c library functions added 4. Now generates code for 27 Boards(arduino and lilypad). 5. New GUI --- macros/scilab2c.sci | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'macros/scilab2c.sci') diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci index 41494ea..69d9554 100644 --- a/macros/scilab2c.sci +++ b/macros/scilab2c.sci @@ -133,6 +133,40 @@ function scilab2c(varargin) RunMode = varargin(4); BuildTool = varargin(5); Target = varargin(6); + case 7 + 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" & varargin(4) <> "FunCall" + error(msprintf(gettext("%s: argument #%d must be: ""All"", ""Translate"" ,""GenLibraryStructure"" or ""FunCall"".\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" & varargin(6) <> "AVR" & varargin(6) <> "RPi" + error(msprintf(gettext("%s: argument #%d must be: ""StandAlone"" or ""Arduino"" or ""AVR"" or ""RPi"".\n"),"scilab2c",5)); + return + end + //if varargin(7) <> "uno" & varargin(7) <> "mega" & varargin(7) <> "mega2560" & varargin(7) <> "micro" & varargin(7) <> "nano" & varargin(7) <> "mini" + // error(msprintf(gettext("%s: argument #%d must be: ""uno"" or ""mega"" or ""micro"" or ""nano"" or ""mini"".\n"),"scilab2c",7)); + //return + //end + UserScilabMainFile = varargin(1); + CCodeOutputDir = varargin(2); + if varargin(3) == "" + UserSciFilesPaths = []; + else + UserSciFilesPaths = varargin(3); + end + RunMode = varargin(4); + BuildTool = varargin(5); + Target = varargin(6); + Board_name = varargin(7); else // // Calling scilab2c with more than understood values @@ -159,7 +193,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,Target); + runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,Target,Board_name); end endfunction -- cgit From 240e5e93815eef0992834ec7bd2a8162acca13f0 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 21 Jun 2017 15:15:50 +0530 Subject: Bug related to Arduino 'Board name' solved --- macros/scilab2c.sci | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'macros/scilab2c.sci') diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci index 69d9554..61ac42d 100644 --- a/macros/scilab2c.sci +++ b/macros/scilab2c.sci @@ -12,6 +12,7 @@ function scilab2c(varargin) [lhs, rhs] = argn(); + disp("YES") select rhs // // scilab2c() @@ -35,6 +36,7 @@ function scilab2c(varargin) RunMode = 'All'; BuildTool = getNativeBuildTool(); Target = "StandAlone" + //Board_name = "uno" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths) // @@ -55,6 +57,7 @@ function scilab2c(varargin) RunMode = "All"; BuildTool = getNativeBuildTool(); Target = "StandAlone" + //Board_name = "uno" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // @@ -79,6 +82,7 @@ function scilab2c(varargin) RunMode = varargin(4); BuildTool = getNativeBuildTool(); Target = "StandAlone" + //Board_name = "uno" case 5 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -104,6 +108,7 @@ function scilab2c(varargin) RunMode = varargin(4); BuildTool = varargin(5); Target = "StandAlone" + //Board_name = "uno" case 6 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -133,6 +138,7 @@ function scilab2c(varargin) RunMode = varargin(4); BuildTool = varargin(5); Target = varargin(6); + //Board_name = "uno"; case 7 for i = 1:4 if typeof(varargin(i)) <> "string" -- cgit