diff options
Diffstat (limited to '2.3-1')
75 files changed, 953 insertions, 79 deletions
diff --git a/2.3-1/RUN_TESTS/run_tests.bat b/2.3-1/RUN_TESTS/run_tests.bat index bf3e639b..bf3e639b 100644..100755 --- a/2.3-1/RUN_TESTS/run_tests.bat +++ b/2.3-1/RUN_TESTS/run_tests.bat diff --git a/2.3-1/includes/sci2clib.h b/2.3-1/includes/sci2clib.h index eae03ebb..55b6a349 100644 --- a/2.3-1/includes/sci2clib.h +++ b/2.3-1/includes/sci2clib.h @@ -547,8 +547,24 @@ extern "C" { #include "int_cmd_dcmotor.h" #include "cmd_dcmotor_run.h" #include "cmd_dcmotor_setup.h" +#include "cmd_dcmotor_release.h" #include "int_sleep.h" #include "sleep.h" +#include "int_cmd_analog_in_volt.h" +#include "cmd_analog_in_volt.h" +#include "int_cmd_analog_out_volt.h" +#include "cmd_analog_out_volt.h" +#include "cmd_i2c_dev.h" +#include "int_cmd_i2c_dev.h" +#include "cmd_i2c_write.h" +#include "int_cmd_i2c_write.h" +#include "cmd_i2c_read.h" +#include "int_cmd_i2c_read.h" +#include "cmd_i2c_write_register.h" +#include "int_cmd_i2c_write_register.h" +#include "cmd_i2c_read_register.h" +#include "int_cmd_i2c_read_register.h" + /*#include "cmd_servo_attach.h" #include "cmd_servo_detach.h" #include "cmd_servo_move.h" diff --git a/2.3-1/loader.sce b/2.3-1/loader.sce index 061021cb..92d68830 100644 --- a/2.3-1/loader.sce +++ b/2.3-1/loader.sce @@ -1,20 +1,10 @@ // This file is released under the 3-clause BSD license. See COPYING-BSD. // Generated by builder.sce: Please, do not edit this file -oldmode = mode(); mode(-1); -oldlines = lines()(2); lines(0); try - exec(get_absolute_file_path("loader.sce")+"etc/"+"scilab2c.start"); + getversion("scilab"); catch - [errmsg, tmp, nline, func] = lasterror() - msg = "%s: error on line #%d: ""%s""\n" - msg = msprintf(msg, func, nline, errmsg) - lines(oldlines) - mode(oldmode); - clear oldlines oldmode tmp nline func - error(msg); -end -lines(oldlines); -mode(oldmode); -clear oldlines oldmode; + error("Scilab 5.0 or more is required."); +end; +exec(get_absolute_file_path("loader.sce")+"etc/"+"scilab2c.start"); diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 5ff7181f..65446679 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -429,6 +429,7 @@ NOutArg_mod = NOutArg //#RNU_RES_B PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y'); if(IsArduinoFunction(ASTFunName)) + //disp(ASTFunName) if(IsArduinoSetupFunction(ASTFunName)) //If current function is an arduino setup function (like 'dc_motor_setup'), it //should not be converted and inserted here. It is inserted in a list now and diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib index 8b5224bf..67ea09be 100644 --- a/2.3-1/macros/ASTManagement/lib +++ b/2.3-1/macros/ASTManagement/lib @@ -13,7 +13,7 @@ <macro name="%program_string" file="%program_string.bin" md5="879f4b4f005fd98d8dd1a198e85b4dce"/> <macro name="%variable_string" file="%variable_string.bin" md5="be1ccff22e2958638882c809403b2a36"/> <macro name="%while_string" file="%while_string.bin" md5="3f9300680176235c78bfc42abbe11715"/> - <macro name="AST2Ccode" file="AST2Ccode.bin" md5="ef63ed363eb7ed0ab5e3a6d19b3aa8fc"/> + <macro name="AST2Ccode" file="AST2Ccode.bin" md5="15a60b078a7d01b0ef9aa6ba9ea3f0d9"/> <macro name="AST_CheckCommonInOutArgs" file="AST_CheckCommonInOutArgs.bin" md5="7be23272bbff9b141535b71c0eefb3b4"/> <macro name="AST_CheckLastFunc" file="AST_CheckLastFunc.bin" md5="41af209af677f8fd3c68fd1920a7fcbb"/> <macro name="AST_CheckLineLength" file="AST_CheckLineLength.bin" md5="eb2c4ac2671c0cf8df0ed2fe354ac94c"/> @@ -23,7 +23,7 @@ <macro name="AST_GetASTFile" file="AST_GetASTFile.bin" md5="46b005d916ff66672d4424fe6c867371"/> <macro name="AST_GetFuncallPrm" file="AST_GetFuncallPrm.bin" md5="eae44f2db2aa35208413d2748f4b1eda"/> <macro name="AST_GetPrecAndLhsArg" file="AST_GetPrecAndLhsArg.bin" md5="a295fca5ee80625948428f8cccca4728"/> - <macro name="AST_HandleEOL" file="AST_HandleEOL.bin" md5="f409b060684fb927473057b32ef5d7f0"/> + <macro name="AST_HandleEOL" file="AST_HandleEOL.bin" md5="41ac83445b2b86cffcb1d592fd0c7560"/> <macro name="AST_HandleEndFor" file="AST_HandleEndFor.bin" md5="fdbd73e88f395b5af34aaff8f338257a"/> <macro name="AST_HandleEndGenFun" file="AST_HandleEndGenFun.bin" md5="df5c68198d63a3359690d0ab672cf062"/> <macro name="AST_HandleEndProgram" file="AST_HandleEndProgram.bin" md5="6c15e907c85813690569e22aafe1ad73"/> diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci new file mode 100644 index 00000000..b43eb442 --- /dev/null +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMkfle_arduino.sci @@ -0,0 +1,12 @@ +function C_GenerateMkfle_arduino(FileInfo,SharedInfo) + + PrintStringInfo('ARDUINO_DIR = /usr/share/arduino',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('ARDMK_DIR = /usr/share/arduino',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('AVR_TOOLS_DIR = /usr',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('BOARD_TAG = ' + SharedInfo.Board_name ,FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('USER_LIB_PATH = ../',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('ARDUINO_LIBS = ../src/c ../includes ../interfaces ../ Wire',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('ARDUINO_PORT = /dev/ttyACM0',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('include /usr/share/arduino/Arduino.mk',FileInfo.MakefileFilename,'file','y','y'); + +endfunction diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib index 28e3346a..2db4b8c8 100644 --- a/2.3-1/macros/CCodeGeneration/lib +++ b/2.3-1/macros/CCodeGeneration/lib @@ -6,7 +6,7 @@ <macro name="C_GenDeclarations" file="C_GenDeclarations.bin" md5="ee8ec8971503228c9717c5125fce85f3"/> <macro name="C_GenerateFunName" file="C_GenerateFunName.bin" md5="085877ab44748da056c79995d3555ec2"/> <macro name="C_GenerateLaunchScript" file="C_GenerateLaunchScript.bin" md5="6a7eebd266f6ba252a610a9b6e5e12fe"/> - <macro name="C_GenerateMakefile" file="C_GenerateMakefile.bin" md5="7874d54e825ecb576f9b3e0d9c7d781b"/> + <macro name="C_GenerateMakefile" file="C_GenerateMakefile.bin" md5="2786ec422a65d735cbeef69d14e1e801"/> <macro name="C_GenerateMakefile_msvc" file="C_GenerateMakefile_msvc.bin" md5="d2962ecb30341f5815ddc52e6fc03543"/> <macro name="C_GenerateSCI2CHeader" file="C_GenerateSCI2CHeader.bin" md5="0718f257ee598048a8c8c0fcdb06c8fc"/> <macro name="C_IfElseBlocks" file="C_IfElseBlocks.bin" md5="78d53c95511b9b46ea8739a177efd631"/> diff --git a/2.3-1/macros/CCodeGeneration/names b/2.3-1/macros/CCodeGeneration/names index efbb400a..5311c7fd 100644 --- a/2.3-1/macros/CCodeGeneration/names +++ b/2.3-1/macros/CCodeGeneration/names @@ -6,6 +6,7 @@ C_GenerateFunName C_GenerateLaunchScript C_GenerateMakefile C_GenerateMakefile_msvc +C_GenerateMkfle_arduino C_GenerateSCI2CHeader C_IfElseBlocks C_IfExpression diff --git a/2.3-1/macros/ErrorMessages/lib b/2.3-1/macros/ErrorMessages/lib Binary files differindex 0a9f8913..5370e124 100644 --- a/2.3-1/macros/ErrorMessages/lib +++ b/2.3-1/macros/ErrorMessages/lib diff --git a/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differindex f02997b0..3608981c 100644 --- a/2.3-1/macros/FunctionAnnotation/lib +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionList/lib b/2.3-1/macros/FunctionList/lib Binary files differindex 2bbf0cbe..f5a84d5f 100644 --- a/2.3-1/macros/FunctionList/lib +++ b/2.3-1/macros/FunctionList/lib diff --git a/2.3-1/macros/GeneralFunctions/lib b/2.3-1/macros/GeneralFunctions/lib Binary files differindex e1d6f0fb..9d57416d 100644 --- a/2.3-1/macros/GeneralFunctions/lib +++ b/2.3-1/macros/GeneralFunctions/lib diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differindex 5c8f0da2..7631c354 100644 --- a/2.3-1/macros/Hardware/AVR/lib +++ b/2.3-1/macros/Hardware/AVR/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/lib b/2.3-1/macros/Hardware/RasberryPi/lib Binary files differindex 9afd77da..c238317e 100644 --- a/2.3-1/macros/Hardware/RasberryPi/lib +++ b/2.3-1/macros/Hardware/RasberryPi/lib diff --git a/2.3-1/macros/ImageProcessing/core/lib b/2.3-1/macros/ImageProcessing/core/lib Binary files differindex 56053510..fedf05e1 100644 --- a/2.3-1/macros/ImageProcessing/core/lib +++ b/2.3-1/macros/ImageProcessing/core/lib diff --git a/2.3-1/macros/ImageProcessing/highgui/lib b/2.3-1/macros/ImageProcessing/highgui/lib Binary files differindex a46d5d87..30217607 100644 --- a/2.3-1/macros/ImageProcessing/highgui/lib +++ b/2.3-1/macros/ImageProcessing/highgui/lib diff --git a/2.3-1/macros/ImageProcessing/imgproc/lib b/2.3-1/macros/ImageProcessing/imgproc/lib Binary files differindex 4863059b..ac605c04 100644 --- a/2.3-1/macros/ImageProcessing/imgproc/lib +++ b/2.3-1/macros/ImageProcessing/imgproc/lib diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci index a112fe6a..eff61fe6 100644 --- a/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci +++ b/2.3-1/macros/Scilab-Arduino/GetArduinoFunctions.sci @@ -30,6 +30,7 @@ ArduinoFunctions = [ "cmd_dcmotor_run" "cmd_servo_attach" "cmd_servo_detach" - "cmd_servo_move"]; + "cmd_servo_move" + "i2c_dev"]; endfunction diff --git a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci index d2cd0c74..d310648e 100644 --- a/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci +++ b/2.3-1/macros/Scilab-Arduino/GetArduinoSetupFunctions.sci @@ -24,6 +24,8 @@ function ArduinoSetupFunctions = GetArduinoSetupFunctions() ArduinoSetupFunctions = [ "cmd_dcmotor_setup" "cmd_servo_attach" - "cmd_servo_detach"]; + "cmd_servo_detach" + "i2c_dev"]; + endfunction diff --git a/2.3-1/macros/Scilab-Arduino/IsArduinoSetupFunction.sci b/2.3-1/macros/Scilab-Arduino/IsArduinoSetupFunction.sci index 3e1c18fb..4afceca8 100644 --- a/2.3-1/macros/Scilab-Arduino/IsArduinoSetupFunction.sci +++ b/2.3-1/macros/Scilab-Arduino/IsArduinoSetupFunction.sci @@ -9,6 +9,7 @@ // Email: toolbox@scilab.in function Output = IsArduinoSetupFunction(FunName) +disp(FunName) // ----------------------------------------------------------------- // Check whether input function name is an Arduino setup function or not. // @@ -25,6 +26,7 @@ function Output = IsArduinoSetupFunction(FunName) //Get list of supported functions for Arduino ArduinoSetupFunctions = GetArduinoSetupFunctions(); + //Check whether input function is present in above list or not FunNameInArduinoSetup = members(FunName,ArduinoSetupFunctions); Output = bool2s(FunNameInArduinoSetup~=0); diff --git a/2.3-1/macros/Scilab-Arduino/i2c_dev.sci b/2.3-1/macros/Scilab-Arduino/i2c_dev.sci new file mode 100644 index 00000000..f86e588a --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/i2c_dev.sci @@ -0,0 +1,3 @@ +function z = i2c_dev(address) + z = 0 +endfunction diff --git a/2.3-1/macros/Scilab-Arduino/i2c_read.sci b/2.3-1/macros/Scilab-Arduino/i2c_read.sci new file mode 100644 index 00000000..6916b9c1 --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/i2c_read.sci @@ -0,0 +1,2 @@ +function y = i2c_read(address,bytes) +endfunction diff --git a/2.3-1/macros/Scilab-Arduino/i2c_read_register.sci b/2.3-1/macros/Scilab-Arduino/i2c_read_register.sci new file mode 100644 index 00000000..51a88eeb --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/i2c_read_register.sci @@ -0,0 +1,3 @@ +function x = i2c_read_register(address,reg_adrs) + x = 0; +endfunction diff --git a/2.3-1/macros/Scilab-Arduino/i2c_write.sci b/2.3-1/macros/Scilab-Arduino/i2c_write.sci new file mode 100644 index 00000000..8dfd070a --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/i2c_write.sci @@ -0,0 +1,2 @@ +function i2c_write(address,data) +endfunction diff --git a/2.3-1/macros/Scilab-Arduino/i2c_write_register.sci b/2.3-1/macros/Scilab-Arduino/i2c_write_register.sci new file mode 100644 index 00000000..a9b55530 --- /dev/null +++ b/2.3-1/macros/Scilab-Arduino/i2c_write_register.sci @@ -0,0 +1,2 @@ +function i2c_write_register(address, reg_adrs, data) +endfunction diff --git a/2.3-1/macros/Scilab-Arduino/lib b/2.3-1/macros/Scilab-Arduino/lib Binary files differindex 0304cade..83baacde 100644 --- a/2.3-1/macros/Scilab-Arduino/lib +++ b/2.3-1/macros/Scilab-Arduino/lib diff --git a/2.3-1/macros/Scilab-Arduino/names b/2.3-1/macros/Scilab-Arduino/names index 55eb6fef..c1386c3b 100644 --- a/2.3-1/macros/Scilab-Arduino/names +++ b/2.3-1/macros/Scilab-Arduino/names @@ -4,3 +4,8 @@ GetArduinoSetupFunctions InsertSetupInList IsArduinoFunction IsArduinoSetupFunction +i2c_dev +i2c_read +i2c_read_register +i2c_write +i2c_write_register diff --git a/2.3-1/macros/SymbolTable/ST_GetInArgInfo.sci b/2.3-1/macros/SymbolTable/ST_GetInArgInfo.sci index 9f5cbd4e..4c85408c 100644 --- a/2.3-1/macros/SymbolTable/ST_GetInArgInfo.sci +++ b/2.3-1/macros/SymbolTable/ST_GetInArgInfo.sci @@ -49,13 +49,13 @@ for cntinarg = 1:NInArg tmpname = InArg(cntinarg).Name;
tmpscope = InArg(cntinarg).Scope;
lengthNumber = length('Number_');
- if (part(tmpscope,1:lengthNumber) == 'Number_')
+ if (part(tmpscope,1:lengthNumber) == 'Number_')
// #RNU_RES_B
PrintStringInfo('Input Argument '+string(cntinarg)+' is a number: '+tmpname+'.',FileInfo.Funct(nxtscifunnumber).ReportFileName,'file');
// #RNU_RES_E
UpdatedInArg(cntinarg).Type = part(tmpscope,lengthNumber+1:lengthNumber+1);
if (UpdatedInArg(cntinarg).Type == 'x')
- UpdatedInArg(cntinarg).Type = SharedInfo.DefaultPrecision; // It is the default.
+ UpdatedInArg(cntinarg).Type = SharedInfo.DefaultPrecision; // It is the default
elseif (UpdatedInArg(cntinarg).Type == 'X')
if (SharedInfo.DefaultPrecision == 's')
UpdatedInArg(cntinarg).Type = 'c'; // It is the default.
@@ -101,6 +101,17 @@ for cntinarg = 1:NInArg UpdatedInArg(cntinarg).FindLike = 0;
UpdatedInArg(cntinarg).Dimension = 0;
UpdatedInArg(cntinarg).Scope = 'Number';
+ if((ASTFunName == 'cmd_analog_in' | ASTFunName == 'cmd_analog_in_volt' ) & cntinarg == 2)
+ numvalue = eval(tmpname);
+ if (SharedInfo.Board_name == 'mega' | SharedInfo.Board_name == 'mega2560') then
+ tmpname = string(numvalue + 54)
+ UpdatedInArg(cntinarg).Value = 54 + numvalue;
+ else
+ tmpname = string(numvalue + 14)
+ UpdatedInArg(cntinarg).Value = 14 + numvalue;
+ end
+ UpdatedInArg(cntinarg).Name = tmpname; // Change the name.
+ end
elseif (tmpscope == 'String')
// #RNU_RES_B
diff --git a/2.3-1/macros/SymbolTable/ST_InsOutArg.sci b/2.3-1/macros/SymbolTable/ST_InsOutArg.sci index f4958ff7..fd6b426c 100644 --- a/2.3-1/macros/SymbolTable/ST_InsOutArg.sci +++ b/2.3-1/macros/SymbolTable/ST_InsOutArg.sci @@ -47,8 +47,6 @@ PrintStringInfo('***Putting output arguments in the symbol table***',ReportFileN // ---------------------------
// --- End Initialization. ---
// ---------------------------
-
-
for counteroutput = 1:NOutArg
// #RNU_RES_B
PrintStringInfo(' Symbol ""'+OutArg(counteroutput).Name+'""',ReportFileName,'file','y','n');
diff --git a/2.3-1/macros/SymbolTable/lib b/2.3-1/macros/SymbolTable/lib Binary files differindex dbc603e2..59ce4653 100644 --- a/2.3-1/macros/SymbolTable/lib +++ b/2.3-1/macros/SymbolTable/lib diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 009ff539..313d25b2 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4486,6 +4486,7 @@ ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); PrintStringInfo('d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
PrintStringInfo('d0d0u80'+ArgSeparator+'',ClassFileName,'file','y');
+
// --- Annotation Function And Function List Function. ---
FunctionName = 'cmd_analog_out';
PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
@@ -4636,6 +4637,165 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class cmd_analog_in_volt -----------
+//------------------------------------
+ClassName = 'cmd_analog_in_volt';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''s''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'s0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_analog_in_volt';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class cmd_i2c_dev -----------
+//------------------------------------
+ClassName = 'cmd_i2c_dev';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_i2c_dev';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
+//---- Class cmd_i2c_write -----------
+//------------------------------------
+ClassName = 'cmd_i2c_write';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''s''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_i2c_write';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class cmd_i2c_read -----------
+//------------------------------------
+ClassName = 'cmd_i2c_read';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''s''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'s0',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'s0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_i2c_read';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class cmd_i2c_read_register -----------
+//------------------------------------
+ClassName = 'cmd_i2c_read_register';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u16''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'u160',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_i2c_read_register';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
+//---- Class cmd_i2c_write_register -----------
+//------------------------------------
+ClassName = 'cmd_i2c_write_register';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''s''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('u80d0d0'+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_i2c_write_register';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+
+//------------------------------------
//---- Class Sleep -------------------
//------------------------------------
@@ -4662,6 +4822,57 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class cmd_analog_out_volt ----------
+//------------------------------------
+ClassName = 'cmd_analog_out_volt';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'',ClassFileName,'file','y');
+PrintStringInfo('d0d0s0'+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_analog_out_volt';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class cmd_dcmotor_release -------
+//------------------------------------
+ClassName = 'cmd_dcmotor_release';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 0 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0'+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_dcmotor_release';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+
+//------------------------------------
//---Functions for AVR ---------------
//------------------------------------
diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci index abe813cc..3c682bf8 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,Target)
+function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,Target,Board_name)
// function SharedInfo = INIT_GenSharedInfo(WorkingDir,OutCCCodeDir,UserSciFilesPaths,...
// RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName)
// -----------------------------------------------------------------
@@ -132,4 +132,6 @@ SharedInfo.Includelist = list(); //Maintains list of functions being used in cod // to add their header files to main function.
SharedInfo.OpenCVUsed = %F; // Specifies if opencv library is used or not
+SharedInfo.Board_name = Board_name; //Specifies Name of Arduino board
+
endfunction
diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci index 82533022..b6da9bd1 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,Target)
+ INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,Target,Board_name)
// 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,Target);
+ TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t,Target,Board_name);
// ----------------------------
// --- Initialize FileInfo. ---
diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib index f92adcd7..4d03bdc5 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <scilablib name="scilab2clib"> <macro name="INIT_CreateDirs" file="INIT_CreateDirs.bin" md5="5b23f4434e84d9a783841b3bbd77a8ed"/> - <macro name="INIT_FillSCI2LibCDirs" file="INIT_FillSCI2LibCDirs.bin" md5="44aca48a3736c5f88da03cea2e948f97"/> + <macro name="INIT_FillSCI2LibCDirs" file="INIT_FillSCI2LibCDirs.bin" md5="ee49a61032430fd6560031777c35bc76"/> <macro name="INIT_GenAnnFLFunctions" file="INIT_GenAnnFLFunctions.bin" md5="682d03ac085a9d855a7057ba0a7f539a"/> <macro name="INIT_GenFileInfo" file="INIT_GenFileInfo.bin" md5="a4e048fb09778089af4740d69f1bdbe7"/> <macro name="INIT_GenLibraries" file="INIT_GenLibraries.bin" md5="f839fe378df2a79345c693ad0a1a6ed5"/> diff --git a/2.3-1/macros/cb_sci2c_gui.sci b/2.3-1/macros/cb_sci2c_gui.sci index 8f3f92ad..9dbe9742 100644 --- a/2.3-1/macros/cb_sci2c_gui.sci +++ b/2.3-1/macros/cb_sci2c_gui.sci @@ -64,8 +64,13 @@ elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","ou set(findobj("tag", "outformatradioavr"), "value", 0); set(findobj("tag", "outformatradiorpi"), "value", 0); set(gcbo, "value", 1); - - + if get(findobj("tag", "outformatradioarduino"), "value") == 1 then + set(findobj("tag", "brdnmType"), "enable", "on"); + else + set(findobj("tag", "brdnmType"), "enable", "off"); + end + //disp("YES") + //disp(get(findobj("tag", "brdnmType"), "value")) // // --- Copy Scilab code into C option --- // @@ -121,6 +126,64 @@ elseif get(gcbo, "tag")=="convertbtn" then elseif get(findobj("tag", "outformatradiorpi"), "value") == 1 then Target = "RPi"; end + if get(findobj("tag", "brdnmType"), "value") == 2 then + Board_name = "uno" + elseif get(findobj("tag", "brdnmType"), "value") == 3 then + Board_name = "mega" + elseif get(findobj("tag", "brdnmType"), "value") == 4 then + Board_name = "mega2560" + elseif get(findobj("tag", "brdnmType"), "value") == 5 then + Board_name = "nano" + elseif get(findobj("tag", "brdnmType"), "value") == 6 then + Board_name = "nano328" + elseif get(findobj("tag", "brdnmType"), "value") == 7 then + Board_name = "micro" + elseif get(findobj("tag", "brdnmType"), "value") == 8 then + Board_name = "mini" + elseif get(findobj("tag", "brdnmType"), "value") == 9 then + Board_name = "mini328" + elseif get(findobj("tag", "brdnmType"), "value") == 10 then + Board_name = "pro328" + elseif get(findobj("tag", "brdnmType"), "value") == 11 then + Board_name = "pro" + elseif get(findobj("tag", "brdnmType"), "value") == 12 then + Board_name = "pro5v328" + elseif get(findobj("tag", "brdnmType"), "value") == 13 then + Board_name = "pro5v" + elseif get(findobj("tag", "brdnmType"), "value") == 14 then + Board_name = "atmega168" + elseif get(findobj("tag", "brdnmType"), "value") == 15 then + Board_name = "atmega8" + elseif get(findobj("tag", "brdnmType"), "value") == 16 then + Board_name = "atmega328" + elseif get(findobj("tag", "brdnmType"), "value") == 17 then + Board_name = "bt328" + elseif get(findobj("tag", "brdnmType"), "value") == 18 then + Board_name = "bt" + elseif get(findobj("tag", "brdnmType"), "value") == 19 then + Board_name = "diecimila" + elseif get(findobj("tag", "brdnmType"), "value") == 20 then + Board_name = "esplora" + elseif get(findobj("tag", "brdnmType"), "value") == 21 then + Board_name = "ethernet" + elseif get(findobj("tag", "brdnmType"), "value") == 22 then + Board_name = "fio" + elseif get(findobj("tag", "brdnmType"), "value") == 23 then + Board_name = "leonardo" + elseif get(findobj("tag", "brdnmType"), "value") == 24 then + Board_name = "robotControl" + elseif get(findobj("tag", "brdnmType"), "value") == 25 then + Board_name = "robotMotor" + elseif get(findobj("tag", "brdnmType"), "value") == 26 then + Board_name = "lilypad328" + elseif get(findobj("tag", "brdnmType"), "value") == 27 then + Board_name = "lilypad" + elseif get(findobj("tag", "brdnmType"), "value") == 28 then + Board_name = "lilyPadUSB" + + //elseif get(findobj("tag", "brdnmType"), "value") == [1 0 0 0 0 0] then + //Board_name = "none" + end CopySciCodeIntoCCode = get(findobj("tag", "sciintocradioyes"), "value") == 1; @@ -140,7 +203,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,Target); + scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target,Board_name); // // --- sci2c help --- // diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index dd8b7e1c..e9214a24 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -205,7 +205,15 @@ function allHeaders = getAllHeaders(SharedInfo) //"src/c/scilab-arduino/includes/cmd_servo_attach.h" //"src/c/scilab-arduino/includes/cmd_servo_detach.h" //"src/c/scilab-arduino/includes/cmd_servo_move.h" - "src/c/scilab-arduino/includes/sleep.h"]; + "src/c/scilab-arduino/includes/sleep.h" + "src/c/scilab-arduino/includes/cmd_analog_in_volt.h" + "src/c/scilab-arduino/includes/cmd_analog_out_volt.h" + "src/c/scilab-arduino/includes/cmd_dcmotor_release.h" + "src/c/scilab-arduino/includes/cmd_i2c_dev.h" + "src/c/scilab-arduino/includes/cmd_i2c_write.h" + "src/c/scilab-arduino/includes/cmd_i2c_read.h" + "src/c/scilab-arduino/includes/cmd_i2c_read_register.h" + "src/c/scilab-arduino/includes/cmd_i2c_write_register.h"]; AVR_headers = [ "src/c/hardware/avr/includes/AVRPeripheralGPIO.h" diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index c5c31165..e5c7e0a5 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -197,7 +197,14 @@ function allInterfaces = getAllInterfaces(SharedInfo) "src/c/scilab-arduino/interfaces/int_cmd_analog_in.h" "src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h" "src/c/scilab-arduino/interfaces/int_cmd_servo.h" - "src/c/scilab-arduino/interfaces/int_sleep.h"]; + "src/c/scilab-arduino/interfaces/int_sleep.h" + "src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h" + "src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h" + "src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h" + "src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h" + "src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h" + "src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h" + "src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h"]; //Interface files required for "AVR" output AVR_interfaces = [ diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index fd8b664c..826f670d 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -95,10 +95,6 @@ function allSources = getAllSources(SharedInfo) "src/c/matrixOperations/cat/dcats.c" "src/c/matrixOperations/cat/scata.c" "src/c/matrixOperations/cat/scats.c" - "src/c/matrixOperations/cat/zcata.c" - "src/c/matrixOperations/cat/zcats.c" - "src/c/matrixOperations/cat/ccata.c" - "src/c/matrixOperations/cat/ccats.c" "src/c/matrixOperations/cat/u8cats.c" "src/c/matrixOperations/cat/u8cata.c" "src/c/matrixOperations/cat/u16cats.c" @@ -1202,7 +1198,15 @@ function allSources = getAllSources(SharedInfo) //"src/c/scilab-arduino/cmd_servo_attach/u8cmd_servo_attach.cpp" //"src/c/scilab-arduino/cmd_servo_detach/u8cmd_servo_detach.cpp" //"src/c/scilab-arduino/cmd_servo_move/u8cmd_servo_move.cpp" - "src/c/scilab-arduino/sleep/u16sleeps.c"]; + "src/c/scilab-arduino/sleep/u16sleeps.c" + "src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c" + "src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c" + "src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c" + "src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp" + "src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp" + "src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp" + "src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp" + "src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp"]; //Files to be inserted only if output format selected is 'AVR'. AVR_files = [ @@ -1303,5 +1307,8 @@ function allSources = getAllSources(SharedInfo) allSources = cat(1,allSources,OpenCV_files); end - + //"src/c/matrixOperations/cat/zcata.c" + // "src/c/matrixOperations/cat/zcats.c" + // "src/c/matrixOperations/cat/ccata.c" + //"src/c/matrixOperations/cat/ccats.c" endfunction diff --git a/2.3-1/macros/findDeps/getArduinoFiles.sci b/2.3-1/macros/findDeps/getArduinoFiles.sci index aae8e500..97264575 100644 --- a/2.3-1/macros/findDeps/getArduinoFiles.sci +++ b/2.3-1/macros/findDeps/getArduinoFiles.sci @@ -23,6 +23,5 @@ function arduinoFiles = getArduinoFiles() arduinoFiles = [ "src/c/scilab-arduino/default_files/setup_arduino.h" - "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/lib b/2.3-1/macros/findDeps/lib index d426d8cd..a49dc793 100644 --- a/2.3-1/macros/findDeps/lib +++ b/2.3-1/macros/findDeps/lib @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <scilablib name="scilab2clib"> <macro name="findDeps" file="findDeps.bin" md5="84601fa84fc20d60cf13a314f416eb7a"/> - <macro name="getAllHeaders" file="getAllHeaders.bin" md5="3c63954ca20ef81c5d932af02322fec4"/> + <macro name="getAllHeaders" file="getAllHeaders.bin" md5="8e21ae3669d6db632552aba41eb23170"/> <macro name="getAllInterfaces" file="getAllInterfaces.bin" md5="9d04a03e4f869830242dcc4172a5ab96"/> <macro name="getAllLibraries" file="getAllLibraries.bin" md5="66f2a3077700b6a833c7256fcb1a8c9c"/> <macro name="getAllSources" file="getAllSources.bin" md5="3f7100c25098af239631246751f666c9"/> diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib Binary files differindex d818e184..f2931549 100644 --- a/2.3-1/macros/lib +++ b/2.3-1/macros/lib diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index eb32a4b5..f05cb83d 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,Target)
+function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,Target,Board_name)
// 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, Target);
+ UserSciFilesPaths, SCI2COutputPath, RunMode, Target,Board_name);
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
@@ -177,6 +177,8 @@ if (Target == 'Arduino') //disp("Copying "+arduinoFiles(i)+" in "+SCI2COutputPath+"/arduino/sci2carduino");
copyfile(arduinoFiles(i), SCI2COutputPath+"/arduino/sci2c_arduino/");
end
+ C_GenerateMkfle_arduino(FileInfo,SharedInfo);
+ movefile(FileInfo.MakefileFilename, SCI2COutputPath+"/arduino/sci2c_arduino/");
elseif (Target == 'AVR')
AVRFile = SCI2CHOME + "/" + "src/c/hardware/avr/default_files/Makefile";
copyfile(AVRFile, SCI2COutputPath);
diff --git a/2.3-1/macros/sci2c_gui.sci b/2.3-1/macros/sci2c_gui.sci index 6dbd4628..bee6fe43 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 + 9*widgeth; +figh = 16*margin + btnh + 10*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+6*widgeth],... + "position", [margin 2*margin+btnh figw-2*margin 7*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+6*widgeth-8 50 18],... + "position", [2*margin 5*margin+btnh+4*margin+6*widgeth-8 50 18],... "fontname", defaultfont,... "fontunits", "points",... "fontsize", 11,... @@ -175,6 +175,33 @@ sciintocradiono = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "sciintocradiono"); +// --- Board Name ---- +brdnmy = sciintocy + margin + btnh ; +brdnmlabel = uicontrol("parent", sci2cfig,... + "style", "text",... + "string", gettext("Board Name: "),... + "position",[2*margin brdnmy widgetLabelWidth widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12); + +brdnmType = uicontrol("parent", sci2cfig,... + "style", "popupmenu",... + "string", ["";"Uno";"Mega-ATmega1280";"Mega-2560 or Mega ADK";"Nano - ATmega168";"Nano - ATmega328";"Micro";"Mini - Atmega168";"Mini - Atmega328";"Pro Mini (3.3V, 8MHz) - ATmega328";"Pro Mini (3.3V, 8MHz) - ATmega168";"Pro Mini (5V, 16MHz) - ATmega328";"Pro Mini (5V, 16MHz) - ATmega168";"NG or older - ATmega168";"NG or older - ATmega8";"Duemilanove - ATmega328";"BT - ATmega328";"BT - ATmega 168";"Diecimila/Duemilanove - ATmega168";"Esplora";"Ethernet";"Fio";"Leonardo";"Robot Control";"Robot Motor";"LilyPad Arduino - ATmega328";"LilyPad Arduino - ATmega168";"LilyPad Arduino USB"],... + "position",[2*margin+widgetLabelWidth brdnmy 3*radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "enable", "off",... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0],... + "callback", "cb_sci2c_gui",... + "tag", "brdnmType"); + +sciintocy = brdnmy // --- Output format: Standalone or Arduino outformaty = sciintocy + margin + btnh ; outformatlabel = uicontrol("parent", sci2cfig,... @@ -240,7 +267,8 @@ outformatradiorpi = uicontrol("parent", sci2cfig,... "max", 1, ... "value", 0,... "callback", "cb_sci2c_gui",... - "tag", "outformatradiorpi"); + "tag", "outformatradiorpi"); + // --- Run mode option --- runy = outformaty + margin + widgeth; @@ -296,7 +324,7 @@ runradiogenlib = uicontrol("parent", sci2cfig,... // --- Output directory --- // ------------------------ // Frame -optframemaxy = 2*margin+btnh + 4*margin+6*widgeth; +optframemaxy = 5*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 41494eac..69d95541 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/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 diff --git a/2.3-1/src/c/elementaryFunctions/includes/sec.h b/2.3-1/src/c/elementaryFunctions/includes/sec.h index 96061583..a04c5f73 100644 --- a/2.3-1/src/c/elementaryFunctions/includes/sec.h +++ b/2.3-1/src/c/elementaryFunctions/includes/sec.h @@ -14,7 +14,7 @@ #include "dynlib_elementaryfunctions.h" #include "floatComplex.h" #include "doubleComplex.h" -#include <complex.h> +//#include <complex.h> #include "types.h" #ifdef __cplusplus diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c b/2.3-1/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c new file mode 100644 index 00000000..7018df2c --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_analog_in_volt/u8cmd_analog_in_volts.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_analog_in_volt.h" +#include "Arduino.h" + +float u8cmd_analog_in_volts(uint8 board_no, uint8 pin) +{ + float a; + a = ((5*(float)analogRead(pin))/1023); + return(a); +} + diff --git a/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c b/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c new file mode 100644 index 00000000..2dd82e41 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_analog_out_volt/u8cmd_analog_out_volts.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_analog_out_volt.h" +#include "Arduino.h" + +void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value) +{ + int a; + a = ((value*255)/5); + analogWrite(pin,a); + +} diff --git a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c new file mode 100644 index 00000000..349bcb17 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_release/u8cmd_dcmotor_releases.c @@ -0,0 +1,29 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#include "cmd_dcmotor_release.h" +#include "Arduino.h" + +void u8cmd_dcmotor_releases(uint8 board_no, uint8 motor_no) +{ + if (dcm_mode[motor_no] == 3) + { + analogWrite(dcm_pin_1[motor_no],0); + analogWrite(dcm_pin_2[motor_no],0); + } + + else + { + digitalWrite(dcm_pin_1[motor_no],LOW); + digitalWrite(dcm_pin_2[motor_no],LOW); + } +} diff --git a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c index 6e1c2caa..e8fa8b3c 100644 --- a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c +++ b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_run/u8cmd_dcmotor_runs.c @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c index 389f9111..0d04e748 100644 --- a/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c +++ b/2.3-1/src/c/scilab-arduino/cmd_dcmotor_setup/u8cmd_dcmotor_setups.c @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp new file mode 100644 index 00000000..adc1a6e5 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_dev/u8cmd_i2c_devs.cpp @@ -0,0 +1,10 @@ +#include "cmd_i2c_dev.h" +#include "Arduino.h" +#include "Wire.h" + + +uint8 u8cmd_i2c_devs(uint8 address) +{ + Wire.begin(); + return((uint8)address); +} diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp new file mode 100644 index 00000000..8f02a87e --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_read/u8cmd_i2c_reads.cpp @@ -0,0 +1,18 @@ +#include "cmd_i2c_read.h" +#include "Arduino.h" +#include "Wire.h" + +float u8cmd_i2c_reads(uint8 address, uint8 bytes) +{ + + float c; //variable declaration to save received data + + // request reading from sensor + Wire.requestFrom(address, bytes); // request no. of bytes(given) from slave device with address + + // receive reading from sensor + while (Wire.available()) //If data is received + c = Wire.read(); //Save received data in variable + return(c); + +} diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp new file mode 100644 index 00000000..0a2ec2ed --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_read_register/u8cmd_i2c_read_registers.cpp @@ -0,0 +1,26 @@ +#include "cmd_i2c_read_register.h" +#include "Arduino.h" +#include "Wire.h" + +uint16 u8cmd_i2c_read_registers(uint8 address, uint8 reg_adrs) +{ + long int reading; + + Wire.beginTransmission(address); // transmit to device address + Wire.write(reg_adrs); // sets register pointer to reg_adrs position + Wire.endTransmission(); // stop transmitting + + // request reading from sensor + Wire.requestFrom(address, 2); // request 2 bytes from slave device with address + + // receive reading from sensor + if (2 <= Wire.available()) // if two bytes were received + { + reading = Wire.read(); // receive high byte (overwrites previous reading) + reading = reading << 8; // shift high byte to be high 8 bits + reading |= Wire.read(); // receive low byte as lower 8 bits + } + + return(reading); + +} diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp new file mode 100644 index 00000000..0239097a --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_write/u8cmd_i2c_writes.cpp @@ -0,0 +1,13 @@ +#include "cmd_i2c_write.h" +#include "Arduino.h" +#include "Wire.h" + +void u8cmd_i2c_writes(uint8 address, uint8 data) +{ + + Wire.beginTransmission(address); //Begins transmission to the device connected to given address + Wire.write(data); //sends data to slave device + Wire.endTransmission(); //Transmission ends + +} + diff --git a/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp b/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp new file mode 100644 index 00000000..63cc7c7a --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/cmd_i2c_write_register/u8cmd_i2c_write_registers.cpp @@ -0,0 +1,16 @@ +#include "cmd_i2c_write_register.h" +#include "Arduino.h" +#include "Wire.h" + +void u8cmd_i2c_write_registers(uint8 address, uint8 reg_adrs, uint8 data) +{ + + + Wire.beginTransmission(address); //Begins transmission to the device connected to given address + Wire.write(reg_adrs); //sets register pointer to reg_adrs position + Wire.write(data); //writes given data on reg_adrs position + Wire.endTransmission(); //Transmission ends + + +} + diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in_volt.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in_volt.h new file mode 100644 index 00000000..ec471426 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_in_volt.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_ANALOG_IN_VOLT_H__ +#define __CMD_ANALOG_IN_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float u8cmd_analog_in_volts(uint8 board_no, uint8 pin); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_ANALOG_IN_VOLT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out_volt.h b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out_volt.h new file mode 100644 index 00000000..51580fbb --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_analog_out_volt.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_ANALOG_OUT_VOLT_H__ +#define __CMD_ANALOG_OUT_VOLT_H__ + +#include "types.h" +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_analog_out_volts(uint8 board_no, uint8 pin, float value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_ANALOG_OUT_VOLT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_release.h b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_release.h new file mode 100644 index 00000000..d185fb5e --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_release.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CMD_DCMOTOR_RELEASE_H__ +#define __CMD_DCMOTOR_RELEASE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; + +void u8cmd_dcmotor_releases(uint8 board_no, uint8 motor_no); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_DCMOTOR_RELEASE_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h index 2b69c99b..1b5d41c1 100644 --- a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_run.h @@ -22,7 +22,7 @@ extern "C" { extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; -void u8cmd_dc_motor_runs(uint8 board_no, uint8 motor_no, int16 duty); +void u8cmd_dcmotor_runs(uint8 board_no, uint8 motor_no, int16 duty); #ifdef __cplusplus } /* extern "C" */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h index cecd4659..45854ffb 100644 --- a/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_dcmotor_setup.h @@ -22,7 +22,7 @@ extern "C" { extern uint8 dcm_pin_1[4], dcm_pin_2[4], dcm_mode[4]; -void u8cmd_dc_motor_setups(uint8 board_no, uint8 driver_type, uint8 motor_no,\ +void u8cmd_dcmotor_setups(uint8 board_no, uint8 driver_type, uint8 motor_no,\ uint8 pin_1, uint8 pin_2); #ifdef __cplusplus diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_dev.h b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_dev.h new file mode 100644 index 00000000..861a8e7b --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_dev.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_DEV_H__ +#define __CMD_I2C_DEV_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8cmd_i2c_devs(uint8 address); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_DEV_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read.h b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read.h new file mode 100644 index 00000000..791bdd38 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_READ_H__ +#define __CMD_I2C_READ_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +float u8cmd_i2c_reads(uint8 address, uint8 bytes); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_READ_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read_register.h b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read_register.h new file mode 100644 index 00000000..ea203adf --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_read_register.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_READ_REGISTER_H__ +#define __CMD_I2C_READ_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint16 u8cmd_i2c_read_registers(uint8 address, uint8 reg_adrs); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_READ_REGISTER_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write.h b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write.h new file mode 100644 index 00000000..6a57222b --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_WRITE_H__ +#define __CMD_I2C_WRITE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_i2c_writes(uint8 address, uint8 data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_WRITE_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write_register.h b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write_register.h new file mode 100644 index 00000000..ff1b9ec0 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/includes/cmd_i2c_write_register.h @@ -0,0 +1,16 @@ +#ifndef __CMD_I2C_WRITE_REGISTER_H__ +#define __CMD_I2C_WRITE_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void u8cmd_i2c_write_registers(uint8 address, uint8 reg_adrs, uint8 data); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __CMD_I2C_WRITE_REGISTER_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h new file mode 100644 index 00000000..e8fe65d7 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_in_volt.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + +#ifndef __INT_CMD_ANALOG_IN_VOLT_H__ +#define __INT_CMD_ANALOG_IN_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_analog_in_volts0(in1,in2) u8cmd_analog_in_volts((uint8)in1,(uint8)in2) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_ANALOG_IN_VOLT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h new file mode 100644 index 00000000..283f8fa0 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_analog_out_volt.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2017 - IIT Bombay - FOSSEE + + 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 + Author: Yash Pratap Singh Tomar + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_CMD_ANALOG_OUT_VOLT_H__ +#define __INT_CMD_ANALOG_OUT_VOLT_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0cmd_analog_out_volt(in1,in2,in3) u8cmd_analog_out_volts((uint8)in1,(uint8)in2,(float)in3) + +#define d0d0s0cmd_analog_out_volt(in1,in2,in3) u8cmd_analog_out_volts((uint8)in1,(uint8)in2,(float)in3) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_ANALOG_OUT_VOLT_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h index 61e0d2e3..d465ff6f 100644 --- a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_dcmotor.h @@ -6,6 +6,7 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ @@ -20,16 +21,16 @@ extern "C" { #endif -#define d0d0d0d0d0cmd_dcmotor_setup(in1,in2,in3,in4,in5)\ - u8cmd_dcmotor_setups((uint8)in1,(uint8)in2,(uint8)in3,\ - (uint8)in4,(uint8)in5) +#define d0d0d0d0d0cmd_dcmotor_setup(in1,in2,in3,in4,in5) u8cmd_dcmotor_setups((uint8)in1,(uint8)in2,(uint8)in3,(uint8)in4,(uint8)in5) #define d0d0d0cmd_dcmotor_run(in1,in2,in3) u8cmd_dcmotor_runs((uint8)in1,\ (uint8)in2, (int16)in3); #define d0d0u160cmd_dcmotor_run(in1,in2,in3) u8cmd_dcmotor_runs((uint8)in1,\ - (uint8)in2, (int16)in3); + (uint8)in2, (int16)in3); + +#define d0d0cmd_dcmotor_release(in1,in2) u8cmd_dcmotor_releases((uint8)in1,(uint8)in2) #ifdef __cplusplus diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h new file mode 100644 index 00000000..c4d93d74 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_dev.h @@ -0,0 +1,17 @@ +#ifndef __INT_CMD_I2C_DEV_H__ +#define __INT_CMD_I2C_DEV_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0cmd_i2c_devu80(in1) u8cmd_i2c_devs((uint8)in1) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_DEV_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h new file mode 100644 index 00000000..b0633a07 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read.h @@ -0,0 +1,19 @@ +#ifndef __INT_CMD_I2C_READ_H__ +#define __INT_CMD_I2C_READ_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_reads0(in1, in2) u8cmd_i2c_reads((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_reads0(in1, in2) u8cmd_i2c_reads((uint8)in1, (uint8)in2) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_READ_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h new file mode 100644 index 00000000..5f4c5298 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_read_register.h @@ -0,0 +1,18 @@ +#ifndef __INT_CMD_I2C_READ_REGISTER_H__ +#define __INT_CMD_I2C_READ_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_read_registeru160(in1, in2) u8cmd_i2c_read_registers((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_read_registeru160(in1, in2) u8cmd_i2c_read_registers((uint8)in1, (uint8)in2) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_READ_REGISTER_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h new file mode 100644 index 00000000..a7705a89 --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write.h @@ -0,0 +1,20 @@ +#ifndef __INT_CMD_I2C_WRITE_H__ +#define __INT_CMD_I2C_WRITE_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0cmd_i2c_write(in1, in2) u8cmd_i2c_writes((uint8)in1, (uint8)in2) + +#define u80d0cmd_i2c_write(in1, in2) u8cmd_i2c_writes((uint8)in1, (uint8)in2) + + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_WRITE_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h new file mode 100644 index 00000000..35c0527e --- /dev/null +++ b/2.3-1/src/c/scilab-arduino/interfaces/int_cmd_i2c_write_register.h @@ -0,0 +1,19 @@ +#ifndef __INT_CMD_I2C_WRITE_REGISTER_H__ +#define __INT_CMD_I2C_WRITE_REGISTER_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define d0d0d0cmd_i2c_write_register(in1, in2, in3) u8cmd_i2c_write_registers((uint8)in1, (uint8)in2, (uint8)in3) + +#define u80d0d0cmd_i2c_write_register(in1, in2, in3) u8cmd_i2c_write_registers((uint8)in1, (uint8)in2, (uint8)in3) + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* __INT_CMD_I2C_WRITE_REGISTER_H__ */ diff --git a/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c b/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c index 88f8a66d..30459782 100644 --- a/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c +++ b/2.3-1/src/c/scilab-arduino/sleep/u16sleeps.c @@ -6,11 +6,13 @@ are also available at http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt Author: Siddhesh Wani + Revised by: Yash Pratap Singh Tomar Organization: FOSSEE, IIT Bombay Email: toolbox@scilab.in */ #include "sleep.h" +#include "Arduino.h" void u16sleeps(uint16 delay_ms) { diff --git a/2.3-1/unloader.sce b/2.3-1/unloader.sce index e4ec09c7..a8bf1673 100644 --- a/2.3-1/unloader.sce +++ b/2.3-1/unloader.sce @@ -1,31 +1,14 @@ // This file is released under the 3-clause BSD license. See COPYING-BSD. // Generated by builder.sce: Please, do not edit this file -oldmode = mode(); mode(-1); -oldlines = lines()(2); lines(0); try - // Unregister the library of macros. This does not unregister its macros - clear scilab2clib - // Del help chapter - if or(getscilabmode() == ["NW";"STD"]) then - mprintf("\tRemove help chapter\n"); - del_help_chapter("scilab2c", %F); - end - // Remove Preferences GUI - if getscilabmode() == "STD" then - removeModulePreferences(get_absolute_file_path("unloader.sce")) - end - // TODO: detect and unlink related gateways + getversion("scilab"); catch - [errmsg, tmp, nline, func] = lasterror() - msg = "%s: error on line #%d: ""%s""\n" - msg = msprintf(msg, func, nline, errmsg) - lines(oldlines) - mode(oldmode); - clear oldlines oldmode tmp nline func - error(msg); + error("Scilab 5.4 or more is required."); +end; + +fileQuit = get_absolute_file_path("unloader.sce") + "etc/" + "scilab2c.quit"; +if isfile(fileQuit) then + exec(fileQuit); end -lines(oldlines); -mode(oldmode); -clear oldlines oldmode; |