diff options
Diffstat (limited to 'macros')
63 files changed, 442 insertions, 88 deletions
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.bin b/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex d5d2e4a..ce6f0d6 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci index f6ae58e..57f5f93 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -46,9 +46,9 @@ ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; Pass1HeaderFileName = FileInfo.Funct(nxtscifunnumber).Pass1HeaderFileName; FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir; CGblDeclarFileName = FileInfo.Funct(nxtscifunnumber).CGblDeclarFileName; -if(SharedInfo.OutFormat == 'AVR') +if(SharedInfo.Target == 'AVR') PeripheralInitListFile = FileInfo.PeripheralInitListFile; -elseif (SharedInfo.OutFormat == 'Arduino') +elseif (SharedInfo.Target == 'Arduino') SetupListFile = FileInfo.SetupListFile; end diff --git a/macros/CCodeGeneration/C_Funcall.bin b/macros/CCodeGeneration/C_Funcall.bin Binary files differindex fec4712..3682387 100644 --- a/macros/CCodeGeneration/C_Funcall.bin +++ b/macros/CCodeGeneration/C_Funcall.bin diff --git a/macros/CCodeGeneration/C_Funcall.sci b/macros/CCodeGeneration/C_Funcall.sci index 166799e..3669e54 100644 --- a/macros/CCodeGeneration/C_Funcall.sci +++ b/macros/CCodeGeneration/C_Funcall.sci @@ -35,7 +35,7 @@ CDeclarationFileName = FileInfo.Funct(nxtscifunnumber).CDeclarationFileName; CInitVarsFileName = FileInfo.Funct(nxtscifunnumber).CInitVarsFileName; IndentLevel = SharedInfo.NIndent; CCall = ''; -OutFormat = SharedInfo.OutFormat; +Target = SharedInfo.Target; // --- Extract Function Info. --- FunctionName = FunInfo.SCIFunctionName; CFunName = FunInfo.CFunctionName; @@ -371,7 +371,7 @@ else if (FlagCall == 0) // Add prototype to the header file - C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName,OutFormat); + C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName,Target); // Add { at the beginning of the function. PrintStringInfo(' {',ReportFileName,'file','y'); diff --git a/macros/CCodeGeneration/C_GenerateFunName.bin b/macros/CCodeGeneration/C_GenerateFunName.bin Binary files differindex 4f3c591..9a4af08 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.bin +++ b/macros/CCodeGeneration/C_GenerateFunName.bin diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index 657258a..54c641f 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,9 +23,9 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; -if(IsAVRSupportFunction(FunctionName)) -//If current function is an AVR function, then function name can be just plain -//function name without any input/output arguments types +if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName))) +//If current function is an AVR or RPi function, then function name can be just +//plain function name without any input/output arguments types CFunName = CFunName+FunctionName; diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex cf4ea0e..feff05f 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index 320d803..424c821 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -26,6 +26,8 @@ SCI2CNInArgCheck(argn(2),2,2); // ----------------------- PrintStepInfo('Generating Builder '+FileInfo.MakefileFilename,... FileInfo.GeneralReport,'both'); + +target = SharedInfo.Target; // --------------------------- // --- End Initialization. --- // --------------------------- @@ -41,28 +43,37 @@ PrintStringInfo('# --- DIRECTORIES AND FILES ---',FileInfo.MakefileFilename,'fil makecsrcdir = pathconvert('src/c', %f, %f, 'u'); makehsrcdir = pathconvert('includes', %f, %f, 'u'); makeisrcdir = pathconvert('interfaces', %f, %f, 'u'); +makelibdir = pathconvert('libraries', %f, %f, 'u'); makesci2cdir = FileInfo.CStyleOutCCCodeDir; PrintStringInfo('CSRCDIR = '+makecsrcdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('HSRCDIR = '+makehsrcdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('ISRCDIR = '+makeisrcdir,FileInfo.MakefileFilename,'file','y','y'); +PrintStringInfo('LIBDIR = '+makelibdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('SCI2CDIR = .',FileInfo.MakefileFilename,'file','y','y'); // Compiler definition -PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); -PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y'); -PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y'); - +if (target == 'RPi') + PrintStringInfo('CC = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y'); +else + PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); +end +PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); +if (target == 'RPi') + PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lbcm2835',FileInfo.MakefileFilename,'file','y','y'); +else + PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y'); +end // Binary definition PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','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; +target = SharedInfo.Target; PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y'); -allSources = getAllSources(outformat); +allSources = getAllSources(target); nbSources = size(allSources); for i = 1:(nbSources(1) - 1) [tmppath,tmpfile,tmpext] = fileparts(allSources(i)); diff --git a/macros/CCodeGeneration/C_InitHeader.bin b/macros/CCodeGeneration/C_InitHeader.bin Binary files differindex 642e75c..957ea50 100644 --- a/macros/CCodeGeneration/C_InitHeader.bin +++ b/macros/CCodeGeneration/C_InitHeader.bin diff --git a/macros/CCodeGeneration/C_InitHeader.sci b/macros/CCodeGeneration/C_InitHeader.sci index dffb972..bc6f252 100644 --- a/macros/CCodeGeneration/C_InitHeader.sci +++ b/macros/CCodeGeneration/C_InitHeader.sci @@ -1,4 +1,4 @@ -function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName,OutFormat) +function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName,Target) // function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName) // ----------------------------------------------------------------- // //NUT: add description here @@ -38,7 +38,7 @@ PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** ----- Target ------ ',HeaderFileName,'file','y'); PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('*/',HeaderFileName,'file','y'); -PrintStringInfo('# define ' + OutFormat + '1 1' ,HeaderFileName,'file','y'); +PrintStringInfo('# define ' + Target + '1 1' ,HeaderFileName,'file','y'); PrintStringInfo('/*',HeaderFileName,'file','y'); PrintStringInfo('** ----------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** --- SCI2C Includes. --- ',HeaderFileName,'file','y'); diff --git a/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin Binary files differnew file mode 100644 index 0000000..2373b81 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib Binary files differindex c2025c8..6e93fb3 100644 --- a/macros/FunctionAnnotation/lib +++ b/macros/FunctionAnnotation/lib diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names index d9300d2..a5f862b 100644 --- a/macros/FunctionAnnotation/names +++ b/macros/FunctionAnnotation/names @@ -37,6 +37,7 @@ FA_SZ_OPPLUSA FA_SZ_OPRC FA_SZ_OPSLASH FA_SZ_OPSTAR +FA_SZ_ROW_COLUMN_CAT FA_SZ_SEL1 FA_SZ_SEL2 FA_TP_C diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin Binary files differnew file mode 100644 index 0000000..4a49b86 --- /dev/null +++ b/macros/Hardware/AVR/AVRUARTSetup.bin diff --git a/macros/Hardware/AVR/buildmacros.sce b/macros/Hardware/AVR/buildmacros.sce index 60fd284..2954a42 100644 --- a/macros/Hardware/AVR/buildmacros.sce +++ b/macros/Hardware/AVR/buildmacros.sce @@ -1,14 +1,3 @@ -// -// 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 -// -// tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib Binary files differindex b198682..64d346a 100644 --- a/macros/Hardware/AVR/lib +++ b/macros/Hardware/AVR/lib diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names index 126da77..624fee8 100644 --- a/macros/Hardware/AVR/names +++ b/macros/Hardware/AVR/names @@ -7,6 +7,7 @@ AVRPWMSetDuty AVRPWMSetup AVRReadADC AVRTimerSetup +AVRUARTSetup GetAVRSupportFunctions GetPeripheral InsertPeripheralInList diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin Binary files differnew file mode 100644 index 0000000..5bea645 --- /dev/null +++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci new file mode 100644 index 0000000..24c2f55 --- /dev/null +++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci @@ -0,0 +1,21 @@ +function AVRSupportFunctions = GetRPISupportFunctions() +// ----------------------------------------------------------------- +// Get list of RPI peripherals supported +// +// Input data: +// None +// +// Output data: +// None +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +AVRSupportFunctions = [ + "RPI_DigitalIn" + "RPI_DigitalOut" + "RPI_DigitalSetup" + "RPI_DelayMilli" + "RPI_DelayMicro"]; + +endfunction diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin Binary files differnew file mode 100644 index 0000000..728e3d8 --- /dev/null +++ b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci new file mode 100644 index 0000000..647b0c8 --- /dev/null +++ b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci @@ -0,0 +1,22 @@ +function Output = IsRPISupportFunction(FunName) +// ----------------------------------------------------------------- +// Check whether input function name is a RPi support function or not. +// +// Input data: +// FunName: Name of the function to be checked +// +// Output data: +// Output: True or False depending whether given function is a RPi +// support functions or not +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +//Get list of supported functions for AVR +RPISupportFunctions = GetRPISupportFunctions(); + +//Check whether input function is present in above list or not +FunNameInRPISupport = members(FunName,RPISupportFunctions); +Output = bool2s(FunNameInRPISupport~=0); + +endfunction diff --git a/macros/Hardware/RasberryPi/RPIDelay.bin b/macros/Hardware/RasberryPi/RPIDelay.bin Binary files differnew file mode 100644 index 0000000..bb8279e --- /dev/null +++ b/macros/Hardware/RasberryPi/RPIDelay.bin diff --git a/macros/Hardware/RasberryPi/RPIDelay.sci b/macros/Hardware/RasberryPi/RPIDelay.sci new file mode 100644 index 0000000..c5080dd --- /dev/null +++ b/macros/Hardware/RasberryPi/RPIDelay.sci @@ -0,0 +1,31 @@ +function RPI_DelayMilli(time) +// Function to insert some delay in code execution. +// +// Calling Sequence +// RPI_DelayMilli(time) +// +// Parameters +// time: time(milliseconds) for which execution is to be delayed +// +// Description +// this function can be used for insertig execution delays. 'time' should be +// specified in milliseconds. If more resolution is required, use 'RPI_DelayMicro' +// for inserting delay in microseconds. +// Note: Delay inserted by this function is not accurate, but depedent on +// operating system, other running tasks etc. +// +// Examples +// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. +// +// See also +// RPI_DelayMicro +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/macros/Hardware/RasberryPi/RPIDelayMicro.bin b/macros/Hardware/RasberryPi/RPIDelayMicro.bin Binary files differnew file mode 100644 index 0000000..a4d32cb --- /dev/null +++ b/macros/Hardware/RasberryPi/RPIDelayMicro.bin diff --git a/macros/Hardware/RasberryPi/RPIDelayMicro.sci b/macros/Hardware/RasberryPi/RPIDelayMicro.sci new file mode 100644 index 0000000..730755b --- /dev/null +++ b/macros/Hardware/RasberryPi/RPIDelayMicro.sci @@ -0,0 +1,30 @@ +function RPI_DelayMicro(time) +// Function to insert some delay in code execution. +// +// Calling Sequence +// RPI_DelayMicro(time) +// +// Parameters +// time: time(microseconds) for which execution is to be delayed +// +// Description +// this function can be used for insertig execution delays. 'time' should be +// specified in microseconds.'time' should be between (1-65536). +// Note: Delay inserted by this function is not accurate, but depedent on +// operating system, other running tasks etc. +// +// Examples +// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. +// +// See also +// RPI_DelayMicro +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin Binary files differnew file mode 100644 index 0000000..a3269a0 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci new file mode 100644 index 0000000..3ea3bf1 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci @@ -0,0 +1,27 @@ +function state = RPI_DigitalIn(pin) +// Function to read current state on digital pins. +// +// Calling Sequence +// state = RPI_DigitalIn(pin) +// +// Parameters +// pin : pin of RPi to be used +// state : current state of the pin (0 -> LOW, 1 -> HIGH) +// +// Description +// This fucntion is used for reading the current state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as input. 'pin' must be specified from list given. 'state' specifies the input state (0 -> Low, 1-> High) +// Examples +// RPI_DigitalIn(RPI_GPIO_P1_03) //Reads the state of pin 3 of header P1. +// +// See also +// RPI_DigitalSetup RPI_DigitalOut +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin Binary files differnew file mode 100644 index 0000000..d6b6b7b --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci new file mode 100644 index 0000000..4836f54 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci @@ -0,0 +1,27 @@ +function RPI_DigitalOut(pin, state) +// Function to output desired state on digital pins. +// +// Calling Sequence +// RPI_DigitalOut(pin, state) +// +// Parameters +// pin : pin of RPi to be used +// state : desired state of the pin (0 -> LOW, 1 -> HIGH) +// +// Description +// This fucntion is used for outputting the desired state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as output. 'pin' must be specified from list given. 'state' specifies the output state (0 -> Low, 1-> High) +// Examples +// RPI_DigitalOut(RPI_GPIO_P1_03,0) //Changes the state of pin 3 of header P1 as 'Low'. +// +// See also +// RPI_DigitalSetup RPI_DigitalIn +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin Binary files differnew file mode 100644 index 0000000..46836cd --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci new file mode 100644 index 0000000..5ce48f0 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci @@ -0,0 +1,27 @@ +function RPI_DigitalSetup(pin, direction) +// Function to setup digital pins. +// +// Calling Sequence +// RPI_DigitalSetup(pin,direction) +// +// Parameters +// pin : pin of RPi to be used +// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT) +// +// Description +// There are few pins available on RPi as Gpio or digital io. These pins can be used as digital output or input. Pin name must be provided from list provided. Please refer '' for complete list of pins. Direction can be 0 or 1 depending upon desired function (Input/output) +// Examples +// RPI_DigitalSetup(RPI_GPIO_P1_03,0) //Sets pin 3 of header P1 as input +// +// See also +// RPI_DigitalIn RPI_DigitalOut +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce new file mode 100644 index 0000000..2954a42 --- /dev/null +++ b/macros/Hardware/RasberryPi/buildmacros.sce @@ -0,0 +1,4 @@ + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib Binary files differnew file mode 100644 index 0000000..5884511 --- /dev/null +++ b/macros/Hardware/RasberryPi/lib diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names new file mode 100644 index 0000000..87fe2cd --- /dev/null +++ b/macros/Hardware/RasberryPi/names @@ -0,0 +1,7 @@ +GetRPISupportFunctions +IsRPISupportFunction +RPIDelay +RPIDelayMicro +RPI_DigitalIn +RPI_DigitalOut +RPI_DigitalSetup diff --git a/macros/Hardware/buildmacros.sce b/macros/Hardware/buildmacros.sce deleted file mode 100644 index 88f0fb2..0000000 --- a/macros/Hardware/buildmacros.sce +++ /dev/null @@ -1,19 +0,0 @@ -// This file is released into the public domain - -Directories = [ "AVR" ]; - - -current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); - -for K=1:size(Directories,"*") - myfile = current_path_buildmacros + filesep() + Directories(K) + filesep() + "buildmacros.sce"; - if isfile(myfile) then - exec(myfile); - end -end - -clear current_path_buildmacros; - -tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); - -clear tbx_build_macros; diff --git a/macros/Scilab-Arduino/GenerateSetupFunction.bin b/macros/Scilab-Arduino/GenerateSetupFunction.bin Binary files differindex 7a5052d..ee4b6f9 100644 --- a/macros/Scilab-Arduino/GenerateSetupFunction.bin +++ b/macros/Scilab-Arduino/GenerateSetupFunction.bin diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex 2653039..a4c9a3f 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 629b3ee..f449010 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4301,6 +4301,111 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class RPI_DigitalSetup --------
+//------------------------------------
+ClassName = 'RPI_DigitalSetup';
+
+// --- 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= ''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+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalSetup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DigitalOut ----------
+//------------------------------------
+ClassName = 'RPI_DigitalOut';
+
+// --- 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= ''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+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalOut';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DigitalIn -----------
+//------------------------------------
+ClassName = 'RPI_DigitalIn';
+
+// --- 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('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalIn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DelayMilli ----------
+//------------------------------------
+ClassName = 'RPI_DelayMilli';
+
+// --- 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('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DelayMilli';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_DelayMicro';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.bin b/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex 4a82f12..eed0cd8 100644 --- a/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.sci b/macros/ToolInitialization/INIT_GenSharedInfo.sci index a61eb72..c213db9 100644 --- a/macros/ToolInitialization/INIT_GenSharedInfo.sci +++ b/macros/ToolInitialization/INIT_GenSharedInfo.sci @@ -1,4 +1,4 @@ -function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,OutFormat)
+function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,Target)
// function SharedInfo = INIT_GenSharedInfo(WorkingDir,OutCCCodeDir,UserSciFilesPaths,...
// RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName)
// -----------------------------------------------------------------
@@ -47,7 +47,7 @@ SharedInfo.Sci2CLibMainHeaderFName = pathconvert(Sci2CLibMainHeaderFName, %f, %f SharedInfo.NextSCIFileName = UserScilabMainFile;
[scipath,funname,sciext] = fileparts(UserScilabMainFile);
SharedInfo.SCIMainFunName = funname;
-if (OutFormat == 'Arduino')
+if (Target == 'Arduino')
SharedInfo.CMainFunName = 'loop_arduino';
else
SharedInfo.CMainFunName = 'main';
@@ -120,6 +120,6 @@ SharedInfo.Extension.FuncListClasses = '.lcls'; // Stands for list class // ------------------------
SharedInfo.ResizeApproach = 'NO_RESIZE'; // 'NO_RESIZE', 'RESIZE_ALL', 'RESIZE_TEMP', 'RESIZE_LOCAL', 'RESIZE_GLOBAL', 'REALLOC_ALL_RESIZE_ALL'
-SharedInfo.OutFormat = OutFormat;
+SharedInfo.Target = Target;
endfunction
diff --git a/macros/ToolInitialization/INIT_SCI2C.bin b/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex c6141d6..91a0d91 100644 --- a/macros/ToolInitialization/INIT_SCI2C.bin +++ b/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/macros/ToolInitialization/INIT_SCI2C.sci b/macros/ToolInitialization/INIT_SCI2C.sci index 6dde05d..e5ee975 100644 --- a/macros/ToolInitialization/INIT_SCI2C.sci +++ b/macros/ToolInitialization/INIT_SCI2C.sci @@ -1,5 +1,5 @@ function [FileInfoDatFile,SharedInfoDatFile] = ...
- INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,OutFormat)
+ INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,Target)
// 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,OutFormat);
+ TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t,Target);
// ----------------------------
// --- Initialize FileInfo. ---
@@ -147,10 +147,10 @@ anscounter = 0; //--------------------------------------------
//---Hardware related initialisation----------
//--------------------------------------------
-if (OutFormat == 'AVR')
+if (Target == 'AVR')
PeripheralList = list();
save(FileInfo.PeripheralInitListFile, 'PeripheralList');
-elseif (OutFormat == 'Arduino')
+elseif (Target == 'Arduino')
SetupList = list();
save(FileInfo.SetupListFile, 'SetupList');
end
diff --git a/macros/ToolInitialization/UpdateSCI2CInfo.bin b/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 16e99c9..c13904d 100644 --- a/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/macros/ToolInitialization/UpdateSCI2CInfo.sci b/macros/ToolInitialization/UpdateSCI2CInfo.sci index 253299a..ed07907 100644 --- a/macros/ToolInitialization/UpdateSCI2CInfo.sci +++ b/macros/ToolInitialization/UpdateSCI2CInfo.sci @@ -61,7 +61,7 @@ FileInfo.Funct(funnumber).PfxP1WhileEpilFileName = fullfile(FileInfo.WorkingDir, FileInfo.Funct(funnumber).CPass1FreeFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_pass1free.c'); FileInfo.Funct(funnumber).CPass2FileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_pass2.c'); FileInfo.Funct(funnumber).Pass1HeaderFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'.h'); -if (SharedInfo.OutFormat == 'Arduino') +if (SharedInfo.Target == 'Arduino') //In case of "Arduino" target, *.cpp files should be generated, not *.c files. FileInfo.Funct(funnumber).FinalCFileName = fullfile(FileInfo.OutCCCodeDir,SharedInfo.NextCFunName+'.cpp'); else diff --git a/macros/buildmacros.sce b/macros/buildmacros.sce index dfeb475..91f5a06 100644 --- a/macros/buildmacros.sce +++ b/macros/buildmacros.sce @@ -10,6 +10,7 @@ Directories = [ "ASTManagement", ... "SymbolTable", ... "ToolInitialization"... "Hardware/AVR"... + "Hardware/RasberryPi"... "Scilab-Arduino" ]; diff --git a/macros/cb_sci2c_gui.bin b/macros/cb_sci2c_gui.bin Binary files differindex 3c70ac3..bc691e4 100644 --- a/macros/cb_sci2c_gui.bin +++ b/macros/cb_sci2c_gui.bin diff --git a/macros/cb_sci2c_gui.sci b/macros/cb_sci2c_gui.sci index b6fbd1a..8f3f92a 100644 --- a/macros/cb_sci2c_gui.sci +++ b/macros/cb_sci2c_gui.sci @@ -57,12 +57,12 @@ elseif or(get(gcbo, "tag")==["runradioall","runradiotranslate","runradiogenlib"] // --- Output format option --- -elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","outformatradioavr"]) then +elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","outformatradioavr","outformatradiorpi"]) then set(findobj("tag", "outformatradiostalone"), "value", 0); set(findobj("tag", "outformatradioarduino"), "value", 0); set(findobj("tag", "outformatradioavr"), "value", 0); - + set(findobj("tag", "outformatradiorpi"), "value", 0); set(gcbo, "value", 1); @@ -113,11 +113,13 @@ elseif get(gcbo, "tag")=="convertbtn" then end if get(findobj("tag", "outformatradiostalone"), "value") == 1 then - OutFormat = "StandAlone"; + Target = "StandAlone"; elseif get(findobj("tag", "outformatradioarduino"), "value") == 1 then - OutFormat = "Arduino"; + Target = "Arduino"; elseif get(findobj("tag", "outformatradioavr"), "value") == 1 then - OutFormat = "AVR"; + Target = "AVR"; + elseif get(findobj("tag", "outformatradiorpi"), "value") == 1 then + Target = "RPi"; end CopySciCodeIntoCCode = get(findobj("tag", "sciintocradioyes"), "value") == 1; @@ -138,7 +140,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,OutFormat); + scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target); // // --- sci2c help --- // diff --git a/macros/findDeps/getAllHeaders.bin b/macros/findDeps/getAllHeaders.bin Binary files differindex 4ed973e..0dbfba5 100644 --- a/macros/findDeps/getAllHeaders.bin +++ b/macros/findDeps/getAllHeaders.bin diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 7cddce2..0f325bd 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -10,7 +10,7 @@ // // -function allHeaders = getAllHeaders(OutFormat) +function allHeaders = getAllHeaders(Target) //Header files common to all types of output format. Standalone_headers = [ @@ -145,12 +145,20 @@ function allHeaders = getAllHeaders(OutFormat) "src/c/hardware/avr/includes/AVRUtil.h" ]; - if OutFormat == "StandAlone" + RPi_headers = [ + "includes/bcm2835.h" + "src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h" + "src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h" + ]; + + if Target == "StandAlone" allHeaders = Standalone_headers; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allHeaders = cat(1,Standalone_headers, Arduino_headers); - elseif OutFormat == "AVR" + elseif Target == "AVR" allHeaders = cat(1,Standalone_headers, AVR_headers); + elseif Target == "RPi" + allHeaders = cat(1,Standalone_headers, RPi_headers); end endfunction diff --git a/macros/findDeps/getAllInterfaces.bin b/macros/findDeps/getAllInterfaces.bin Binary files differindex 368b84a..80868ed 100644 --- a/macros/findDeps/getAllInterfaces.bin +++ b/macros/findDeps/getAllInterfaces.bin diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index 65ee174..e233353 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -10,7 +10,7 @@ // // -function allInterfaces = getAllInterfaces(OutFormat) +function allInterfaces = getAllInterfaces(Target) //Interface files common to all types of output format Standalone_interfaces = [ "src/c/auxiliaryFunctions/interfaces/int_rand.h" @@ -139,12 +139,20 @@ function allInterfaces = getAllInterfaces(OutFormat) "src/c/hardware/avr/interfaces/int_AVRUtil.h" ]; - if OutFormat == "StandAlone" + RPI_interfaces = [ + "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h" + "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h" + +]; + + if Target == "StandAlone" allInterfaces = Standalone_interfaces; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allInterfaces = cat(1,Standalone_interfaces, Arduino_interfaces); - elseif OutFormat == "AVR" + elseif Target == "AVR" allInterfaces = cat(1,Standalone_interfaces, AVR_interfaces); + elseif Target == "RPi" + allInterfaces = cat(1,Standalone_interfaces, RPI_interfaces); end endfunction diff --git a/macros/findDeps/getAllLibraries.bin b/macros/findDeps/getAllLibraries.bin Binary files differnew file mode 100644 index 0000000..e6ddf71 --- /dev/null +++ b/macros/findDeps/getAllLibraries.bin diff --git a/macros/findDeps/getAllLibraries.sci b/macros/findDeps/getAllLibraries.sci new file mode 100644 index 0000000..1d633ea --- /dev/null +++ b/macros/findDeps/getAllLibraries.sci @@ -0,0 +1,17 @@ + +function allLibraries = getAllLibraries(Target) + + //Library files required for "RasberryPi" target + RPi_libs = [ + "src/c/hardware/rasberrypi/libraries/libbcm2835.a" + "src/c/hardware/rasberrypi/libraries/libcblas.a" + "src/c/hardware/rasberrypi/libraries/librefblas.a" + "src/c/hardware/rasberrypi/libraries/liblapack.a" + "src/c/hardware/rasberrypi/libraries/libgfortran.a" + ]; + + if Target == "RPi" + allLibraries = RPi_libs; + end + +endfunction diff --git a/macros/findDeps/getAllSources.bin b/macros/findDeps/getAllSources.bin Binary files differindex a81e474..82a109a 100644 --- a/macros/findDeps/getAllSources.bin +++ b/macros/findDeps/getAllSources.bin diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 56a8fea..ca9ac8b 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -10,7 +10,7 @@ // // -function allSources = getAllSources(OutFormat) +function allSources = getAllSources(Target) //Files common to types of output format Standalone_files = [ "src/c/auxiliaryFunctions/abs/sabsa.c" "src/c/auxiliaryFunctions/abs/sabss.c" @@ -858,13 +858,23 @@ function allSources = getAllSources(OutFormat) "src/c/hardware/avr/util/u16AVRSleeps.c" ]; + RPI_files = [ + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c" + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c" + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c" + "src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c" + "src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c" - if OutFormat == "StandAlone" +]; + + if Target == "StandAlone" allSources = Standalone_files; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allSources = cat(1,Standalone_files, Arduino_files); - elseif OutFormat == "AVR" + elseif Target == "AVR" allSources = cat(1,Standalone_files, AVR_files); + elseif Target == "RPi" + allSources = cat(1,Standalone_files, RPI_files); end endfunction diff --git a/macros/findDeps/lib b/macros/findDeps/lib Binary files differindex 8d3728f..c1deaa6 100644 --- a/macros/findDeps/lib +++ b/macros/findDeps/lib diff --git a/macros/findDeps/names b/macros/findDeps/names index dc32fef..2b8c551 100644 --- a/macros/findDeps/names +++ b/macros/findDeps/names @@ -2,5 +2,6 @@ Scilab2CDeps findDeps getAllHeaders getAllInterfaces +getAllLibraries getAllSources getArduinoFiles diff --git a/macros/runsci2c.bin b/macros/runsci2c.bin Binary files differindex 6c09823..f6fd239 100644 --- a/macros/runsci2c.bin +++ b/macros/runsci2c.bin diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci index 4620705..b55a7a1 100644 --- a/macros/runsci2c.sci +++ b/macros/runsci2c.sci @@ -1,4 +1,4 @@ -function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,OutFormat)
+function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,Target)
// 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, OutFormat);
+ UserSciFilesPaths, SCI2COutputPath, RunMode, Target);
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
@@ -92,14 +92,16 @@ end // ---------------------------
global SCI2CHOME
-allSources = SCI2CHOME + "/" + getAllSources(OutFormat);
-allHeaders = SCI2CHOME + "/" +getAllHeaders(OutFormat);
-allInterfaces = SCI2CHOME + "/" + getAllInterfaces(OutFormat);
+allSources = SCI2CHOME + "/" + getAllSources(Target);
+allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
+allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
+allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
mkdir(SCI2COutputPath+"/src/");
mkdir(SCI2COutputPath+"/src/c/");
mkdir(SCI2COutputPath+"/includes/");
mkdir(SCI2COutputPath+"/interfaces/");
+mkdir(SCI2COutputPath+"/libraries/");
// -- Sources
PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
@@ -125,6 +127,13 @@ for i = 1:size(allInterfaces, "*") copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
end
+// -- Libraries
+PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
+for i = 1:size(allLibraries, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
+end
// --------------------------
// --- Generate Makefile. ---
@@ -132,7 +141,7 @@ end //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')
+if (Target == 'Arduino')
GenerateSetupFunction(FileInfo);
mkdir(SCI2COutputPath+"/arduino/");
diff --git a/macros/sci2c_gui.bin b/macros/sci2c_gui.bin Binary files differindex 2e72ec4..57a2f69 100644 --- a/macros/sci2c_gui.bin +++ b/macros/sci2c_gui.bin diff --git a/macros/sci2c_gui.sci b/macros/sci2c_gui.sci index cb75b15..6dbd462 100644 --- a/macros/sci2c_gui.sci +++ b/macros/sci2c_gui.sci @@ -203,7 +203,7 @@ outformatradiostalone = uicontrol("parent", sci2cfig,... outformatradioarduino = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("Arduino"),... - "position",[2*margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... + "position",[margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -217,7 +217,7 @@ outformatradioarduino = uicontrol("parent", sci2cfig,... outformatradioavr = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("AVR"),... - "position",[2*margin+widgetLabelWidth+3*radiow outformaty radiow widgeth],... + "position",[margin+widgetLabelWidth+3*radiow outformaty radiow widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -228,6 +228,20 @@ outformatradioavr = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "outformatradioavr"); +outformatradiorpi = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Rpi"),... + "position",[margin+widgetLabelWidth+4*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradiorpi"); + // --- Run mode option --- runy = outformaty + margin + widgeth; runlabel = uicontrol("parent", sci2cfig,... diff --git a/macros/scilab2c.bin b/macros/scilab2c.bin Binary files differindex 6defd94..ff634b6 100644 --- a/macros/scilab2c.bin +++ b/macros/scilab2c.bin diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci index 3eab16e..118232e 100644 --- a/macros/scilab2c.sci +++ b/macros/scilab2c.sci @@ -35,7 +35,7 @@ function scilab2c(varargin) UserSciFilesPaths = []; RunMode = 'All'; BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths) // @@ -55,7 +55,7 @@ function scilab2c(varargin) end RunMode = "All"; BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // @@ -79,7 +79,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" case 5 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -104,7 +104,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = varargin(5); - OutFormat = "StandAlone" + Target = "StandAlone" case 6 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -120,7 +120,7 @@ function scilab2c(varargin) 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" + 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"".\n"),"scilab2c",5)); return end @@ -133,7 +133,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = varargin(5); - OutFormat = varargin(6); + Target = varargin(6); else // // Calling scilab2c with more than understood values @@ -143,8 +143,8 @@ 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 choosen is 'Standalone' then only execute the code, otherwise directly start conversion. - if OutFormat == "StandAlone" +// If Target choosen is 'Standalone' then only execute the code, otherwise directly start conversion. + if Target == "StandAlone" runscicode(UserScilabMainFile, UserSciFilesPaths); // --- ASK USER FOR CONTINUATION. --- @@ -160,7 +160,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,OutFormat); + runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,Target); end endfunction |