summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/ASTManagement/AST_HandleEndGenFun.binbin90028 -> 92828 bytes
-rw-r--r--macros/ASTManagement/AST_HandleEndGenFun.sci34
-rw-r--r--macros/ASTManagement/AST_HandleHeader.binbin40076 -> 40400 bytes
-rw-r--r--macros/ASTManagement/AST_HandleHeader.sci9
-rw-r--r--macros/CCodeGeneration/C_FinalizeCode.binbin16292 -> 16292 bytes
-rw-r--r--macros/CCodeGeneration/C_FinalizeCode.sci6
-rw-r--r--macros/CCodeGeneration/C_Funcall.binbin71972 -> 73096 bytes
-rw-r--r--macros/CCodeGeneration/C_Funcall.sci277
-rw-r--r--macros/CCodeGeneration/C_GenerateFunName.binbin6736 -> 7776 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateFunName.sci7
-rw-r--r--macros/CCodeGeneration/C_GenerateMakefile.binbin27976 -> 28780 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateMakefile.sci12
-rw-r--r--macros/CCodeGeneration/C_Type.binbin5232 -> 5564 bytes
-rw-r--r--macros/CCodeGeneration/C_Type.sci4
-rw-r--r--macros/CCodeGeneration/JoinDeclarAndCcode.binbin22604 -> 22776 bytes
-rw-r--r--macros/CCodeGeneration/JoinDeclarAndCcode.sci6
-rw-r--r--macros/FunctionAnnotation/FA_GetOutArgInfo.binbin16800 -> 16804 bytes
-rw-r--r--macros/FunctionAnnotation/FA_GetOutArgInfo.sci1
-rw-r--r--macros/Hardware/RasberryPi/GetRPISupportFunctions.binbin1604 -> 2784 bytes
-rw-r--r--macros/Hardware/RasberryPi/GetRPISupportFunctions.sci16
-rw-r--r--macros/Hardware/RasberryPi/RPI_GetMicros.binbin0 -> 3568 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_GetMicros.sci31
-rw-r--r--macros/Hardware/RasberryPi/RPI_GetMillis.binbin0 -> 3556 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_GetMillis.sci31
-rw-r--r--macros/Hardware/RasberryPi/RPI_PinISR.binbin0 -> 6640 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_PinISR.sci47
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialClose.binbin0 -> 2724 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialClose.sci25
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialFlush.binbin0 -> 3120 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialFlush.sci26
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialGetChar.binbin0 -> 3400 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialGetChar.sci28
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSendChar.binbin0 -> 3344 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSendChar.sci29
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSendData.binbin0 -> 3344 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSendData.sci30
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSetup.binbin0 -> 3356 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_SerialSetup.sci28
-rw-r--r--macros/Hardware/RasberryPi/libbin816 -> 1056 bytes
-rw-r--r--macros/Hardware/RasberryPi/names10
-rw-r--r--macros/Hardware/RasberryPi/u16RPISerialDataAvail.binbin0 -> 3520 bytes
-rw-r--r--macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci29
-rw-r--r--macros/SymbolTable/ST_GetInArgInfo.binbin33076 -> 37196 bytes
-rw-r--r--macros/SymbolTable/ST_GetInArgInfo.sci22
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.binbin1170476 -> 1207028 bytes
-rw-r--r--macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci208
-rw-r--r--macros/ToolInitialization/INIT_GenSharedInfo.binbin20728 -> 20712 bytes
-rw-r--r--macros/ToolInitialization/INIT_GenSharedInfo.sci4
-rw-r--r--macros/findDeps/getAllHeaders.binbin30224 -> 31412 bytes
-rw-r--r--macros/findDeps/getAllHeaders.sci8
-rw-r--r--macros/findDeps/getAllInterfaces.binbin31796 -> 32640 bytes
-rw-r--r--macros/findDeps/getAllInterfaces.sci8
-rw-r--r--macros/findDeps/getAllLibraries.binbin1908 -> 1952 bytes
-rw-r--r--macros/findDeps/getAllLibraries.sci2
-rw-r--r--macros/findDeps/getAllSources.binbin185652 -> 191264 bytes
-rw-r--r--macros/findDeps/getAllSources.sci30
-rw-r--r--macros/runsci2c.binbin30492 -> 30892 bytes
-rw-r--r--macros/runsci2c.sci6
-rw-r--r--macros/scilab2c.binbin20192 -> 20180 bytes
-rw-r--r--macros/scilab2c.sci3
60 files changed, 798 insertions, 179 deletions
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.bin b/macros/ASTManagement/AST_HandleEndGenFun.bin
index 82599f3..4da5775 100644
--- a/macros/ASTManagement/AST_HandleEndGenFun.bin
+++ b/macros/ASTManagement/AST_HandleEndGenFun.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci
index eb1d1f4..de5ae80 100644
--- a/macros/ASTManagement/AST_HandleEndGenFun.sci
+++ b/macros/ASTManagement/AST_HandleEndGenFun.sci
@@ -108,11 +108,6 @@ global STACKDEDUG
PrintStringInfo(' ',ReportFileName,'both','y');
error(9999, 'SCI2CERROR: Unexpected number of output arguments for global function.');
end
- //elseif(IsAVRSupportFunction(ASTFunName))
- //Get the peripheral from function name and input arguements, insert it in
- //list of used peripherals.
- // PeripheralUsed=GetPeripheral(ASTFunName,InArg);
- // InsertPeripheralInList(PeripheralUsed,PeripheralInitListFile);
end
// #RNU_RES_B
@@ -194,23 +189,30 @@ global STACKDEDUG
FileInfo.GlobalVarFileName);
end
else
- //If a function is passed as input argument, Change the scope of function name from variable to string,
- //as it is passed as string to C function. Also enter this function in conversion list also.
if(ASTFunName == 'ode')
+ //Differnt handling of ode function is required as one of its input
+ // is a name of a function
if NInArg == 4
- //InArg(4).Scope = 'String';
ODEFunName = InArg(4).Name;
InArg(4).Name = 'odefn'+ InArg(4).Name
//To differentiate functions containing differential equations,
//'odefn' is added at the beginning of the function name.
- SharedInfo.ODElist($+1) = InArg(4).Name;
+ SharedInfo.Includelist($+1) = InArg(4).Name;
//Add ode function in list. this will be used to add corresponding
//header file in main function.
elseif NInArg == 5
ODEFunName = InArg(5).Name;
InArg(5).Name = 'odefn'+ InArg(5).Name
- SharedInfo.ODElist($+1) = InArg(5).Name;
+ SharedInfo.Includelist($+1) = InArg(5).Name;
end
+ elseif(ASTFunName == 'RPI_ThreadCreate')
+ PI_thread_FunName = InArg(1).Name;
+ InArg(1).Name = 'PI_thread_'+PI_thread_FunName;
+ SharedInfo.Includelist($+1) = InArg(1).Name;
+ elseif(ASTFunName == 'RPI_PinISR')
+ PI_ISR_FunName = InArg(3).Name;
+ InArg(3).Name = 'ISR_'+PI_ISR_FunName;
+ SharedInfo.Includelist($+1) = InArg(3).Name;
end
[InArg,SharedInfo] = ST_GetInArgInfo(InArg,NInArg,FileInfo,SharedInfo,ASTFunName);
@@ -513,6 +515,18 @@ global STACKDEDUG
//ODE_CFunName = C_GenerateFunName(ODEFunName,ODE_InArg,2,ODE_OutArg,1);
GenCFunDatFiles(ODEFunName,%t,FunTypeAnnot,['IN(2).SZ(1)' 'IN(2).SZ(2)'],ODE_InArg,2,ODE_OutArg,1,ODE_CFunName,LibTypeInfo,FunInfoDatDir);
SharedInfo = FL_UpdateToBeConv(ODEFunName,ODE_CFunName,%t,FunTypeAnnot,FunSizeAnnot,ODE_InArg,2,ODE_OutArg,1,FileInfo,SharedInfo);
+ elseif ASTFunName == 'RPI_ThreadCreate' then
+ temp_InArg = InArg;
+ temp_InArg(1).Name = ""
+ PI_thread_CFunName = C_GenerateFunName(InArg(1).Name,temp_InArg,0,%t,0);
+ GenCFunDatFiles(PI_thread_FunName,%t,[],%t,temp_InArg,0,%t,0,PI_thread_CFunName,LibTypeInfo,FunInfoDatDir);
+ SharedInfo = FL_UpdateToBeConv(PI_thread_FunName,PI_thread_CFunName,%t,FunTypeAnnot,[],%t,0,%t,0,FileInfo,SharedInfo);
+ elseif ASTFunName == 'RPI_PinISR' then
+ temp_InArg = InArg;
+ temp_InArg(1).Name = ""
+ PI_ISR_CFunName = C_GenerateFunName(InArg(3).Name,temp_InArg,0,%t,0);
+ GenCFunDatFiles(PI_ISR_FunName,%t,[],%t,temp_InArg,0,%t,0,PI_ISR_CFunName,LibTypeInfo,FunInfoDatDir);
+ SharedInfo = FL_UpdateToBeConv(PI_ISR_FunName,PI_ISR_CFunName,%t,FunTypeAnnot,[],%t,0,%t,0,FileInfo,SharedInfo);
end
endfunction
diff --git a/macros/ASTManagement/AST_HandleHeader.bin b/macros/ASTManagement/AST_HandleHeader.bin
index 67e0296..078d21b 100644
--- a/macros/ASTManagement/AST_HandleHeader.bin
+++ b/macros/ASTManagement/AST_HandleHeader.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleHeader.sci b/macros/ASTManagement/AST_HandleHeader.sci
index 41dcd06..98875a3 100644
--- a/macros/ASTManagement/AST_HandleHeader.sci
+++ b/macros/ASTManagement/AST_HandleHeader.sci
@@ -120,8 +120,13 @@ end
// --- Check coherence between In/Out names and In/Out Arg structure loaded. ---
// -----------------------------------------------------------------------------
//#RNU_RES_E
-if (length(SharedInfo.CurrentFunInfo.InArg(1).Name) > 0)
- NInArgDat = size(SharedInfo.CurrentFunInfo.InArg,1);
+if (~isempty(SharedInfo.CurrentFunInfo.InArg))
+
+ if (length(SharedInfo.CurrentFunInfo.InArg(1).Name) > 0)
+ NInArgDat = size(SharedInfo.CurrentFunInfo.InArg,1);
+ else
+ NInArgDat = 0;
+ end
else
NInArgDat = 0;
end
diff --git a/macros/CCodeGeneration/C_FinalizeCode.bin b/macros/CCodeGeneration/C_FinalizeCode.bin
index 44c534e..499d63a 100644
--- a/macros/CCodeGeneration/C_FinalizeCode.bin
+++ b/macros/CCodeGeneration/C_FinalizeCode.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_FinalizeCode.sci b/macros/CCodeGeneration/C_FinalizeCode.sci
index 1f3c6b5..d1fc7e6 100644
--- a/macros/CCodeGeneration/C_FinalizeCode.sci
+++ b/macros/CCodeGeneration/C_FinalizeCode.sci
@@ -76,10 +76,10 @@ PrintStringInfo('#include ""'+tmphdrname+tmphdrext+'""',...
//If current file is main C file, include header files corresponding to ODE
//functions, if any.
if(SharedInfo.NextSCIFunName == SharedInfo.SCIMainFunName)
- if(size(SharedInfo.ODElist) <> 0) //check if list is empty
+ if(size(SharedInfo.Includelist) <> 0) //check if list is empty
//If not empty, add those header files here.
- for cntlist = 1:size(SharedInfo.ODElist)
- PrintStringInfo('#include ""'+SharedInfo.ODElist(cntlist)+'.h""',...
+ for cntlist = 1:size(SharedInfo.Includelist)
+ PrintStringInfo('#include ""'+SharedInfo.Includelist(cntlist)+'.h""',...
FinalCFileName,'file','y');
end
diff --git a/macros/CCodeGeneration/C_Funcall.bin b/macros/CCodeGeneration/C_Funcall.bin
index 23b9e6f..fdfb38d 100644
--- a/macros/CCodeGeneration/C_Funcall.bin
+++ b/macros/CCodeGeneration/C_Funcall.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_Funcall.sci b/macros/CCodeGeneration/C_Funcall.sci
index 22a2770..248b826 100644
--- a/macros/CCodeGeneration/C_Funcall.sci
+++ b/macros/CCodeGeneration/C_Funcall.sci
@@ -174,85 +174,52 @@ end
// --- Generate the C call. ---
// ----------------------------
CCall ='';
-if (FunInfo.CFunctionName == SharedInfo.CMainFunName)
- if (FlagCall == 1)
- error(9999, 'main function called in a source code!');
- else
- CCall =CCall+'int ';
- end
-elseif (mtlb_strcmp(part(CFunName,1:5),'odefn') == %T)
- //Return type of function containing ODEs must be int.
- CCall = CCall + 'int ';
-else
- if (PosFirstOutScalar >= 1)
+if(mtlb_strcmp(part(CFunName,1:9),'PI_thread') == %T)
+//Functions that are to be ru in separate thread in case of RPi target,
+//need to have specific name which is PI_THREAD(functionname)
+
+CCall = CCall + 'PI_THREAD('+CFunName+')'
+else
+
+ if (FunInfo.CFunctionName == SharedInfo.CMainFunName)
if (FlagCall == 1)
- CCall = CCall+OutArg(PosFirstOutScalar).Name+' = ';
+ error(9999, 'main function called in a source code!');
else
- CCall = CCall+C_Type(OutArg(PosFirstOutScalar).Type)+' ';
+ CCall =CCall+'int ';
end
+ elseif ((mtlb_strcmp(part(CFunName,1:5),'odefn') == %T))
+ //Return type of function containing ODEs must be int.
+ CCall = CCall + 'int ';
else
- if (FlagCall == 0)
- CCall = CCall+'void ';
+ if (PosFirstOutScalar >= 1)
+ if (FlagCall == 1)
+ CCall = CCall+OutArg(PosFirstOutScalar).Name+' = ';
+ else
+ CCall = CCall+C_Type(OutArg(PosFirstOutScalar).Type)+' ';
+ end
+ else
+ if (FlagCall == 0)
+ CCall = CCall+'void ';
+ end
end
end
-end
-
-// FIXME : Wrap library function call with prefixed name
-//if CFunName == "main"
- CCall = CCall + CFunName + "(";
-//else
-// CCall = CCall+"SCI2C("+CFunName+")(";
-//end
+ // FIXME : Wrap library function call with prefixed name
-// #RNU_RES_B
-PrintStringInfo(' C call after output scalar args check: '+CCall,ReportFileName,'file','y');
-// #RNU_RES_E
-clear counterin
-if(mtlb_strcmp(part(CFunName,1:5),'odefn') == %F)
- for counterin = 1:NInArg
-
- if (InArg(counterin).Type == 'g' & InArg(counterin).Scope == 'String')
- TmpInArgName = '""'+InArg(counterin).Name+'""';
- elseif (InArg(counterin).Type == 'z' & (InArg(counterin).Scope == 'Number'))
- TmpInArgName = 'DoubleComplex('+SCI2Cstring(real(InArg(counterin).Value))+','+SCI2Cstring(imag(InArg(counterin).Value))+')';
- elseif (InArg(counterin).Type == 'c' & (InArg(counterin).Scope == 'Number'))
- TmpInArgName = 'FloatComplex('+SCI2Cstring(real(InArg(counterin).Value))+','+SCI2Cstring(imag(InArg(counterin).Value))+')';
- else
- TmpInArgName = InArg(counterin).Name;
- end
-
- TmpInArgType = C_Type(InArg(counterin).Type);
+ //if CFunName == "main"
+ CCall = CCall + CFunName + "(";
+ //else
+ // CCall = CCall+"SCI2C("+CFunName+")(";
+ //end
- //if (FunctionName == 'OpEqual')
- // TmpInArgSizeVar = '__'+OutArg(counterin).Name+'Size';
- // else
- TmpInArgSizeVar = '__'+InArg(counterin).Name+'Size';
- //end
+ // #RNU_RES_B
+ PrintStringInfo(' C call after output scalar args check: '+CCall,ReportFileName,'file','y');
+ // #RNU_RES_E
+ clear counterin
+ if(mtlb_strcmp(part(CFunName,1:5),'odefn') == %F)
+ for counterin = 1:NInArg
- if (InArg(counterin).Dimension == 0)
- if (FlagCall == 0)
- CCall = CCall+TmpInArgType+' ';
- end
- CCall = CCall+TmpInArgName+',';
- else
- if (FlagCall == 0)
- CCall = CCall+TmpInArgType+'* '+TmpInArgName+', int* __'+TmpInArgName+'Size,';
- else
- CCall = CCall+TmpInArgName+', '+TmpInArgSizeVar+',';
- end
- end
- end
-else
- //If current function contains 'odefn' at the beginning, then it contains
- //differnetial equations and its function call need to be differnt than
- //other function call. GSL library being used for solving ODEs, requires
- //function containing odes in specific format which is differnt than generated
- //above.
- for counterin = 1:NInArg
-
- //if((NInArg == 4 & counterin <> 3) | (NInArg == 5 & counterin <> 4)) //Skip third argument
if (InArg(counterin).Type == 'g' & InArg(counterin).Scope == 'String')
TmpInArgName = '""'+InArg(counterin).Name+'""';
elseif (InArg(counterin).Type == 'z' & (InArg(counterin).Scope == 'Number'))
@@ -278,93 +245,135 @@ else
CCall = CCall+TmpInArgName+',';
else
if (FlagCall == 0)
- CCall = CCall+TmpInArgType+'* '+TmpInArgName+', ';//int* __'+TmpInArgName+'Size,';
+ CCall = CCall+TmpInArgType+'* '+TmpInArgName+', int* __'+TmpInArgName+'Size,';
else
- CCall = CCall+TmpInArgName+', ';//+TmpInArgSizeVar+',';
+ CCall = CCall+TmpInArgName+', '+TmpInArgSizeVar+',';
end
end
- //end
- end
-
-end
-
-// #RNU_RES_B
-PrintStringInfo(' C call after input args analysis: '+CCall,ReportFileName,'file','y');
-// #RNU_RES_E
-for counterout = 1:NOutArg
- TmpOutArgName = OutArg(counterout).Name;
- TmpOutArgType = C_Type(OutArg(counterout).Type);
- if (counterout == PosFirstOutScalar)
- if (FlagCall == 0)
- // #RNU_RES_B
- // --- Write in the declaration file the returned output scalar (if any). ---
- // #RNU_RES_E
- outscalardeclaration = TmpOutArgType+' '+TmpOutArgName+';';
- // #RNU_RES_B
- PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
- // #RNU_RES_E
- PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CDeclarationFileName,'file','y');
- PrintStringInfo(' ',CDeclarationFileName,'file','y');
end
else
- if (OutArg(counterout).Dimension == 0)
+ //If current function contains 'odefn' at the beginning, then it contains
+ //differnetial equations and its function call need to be differnt than
+ //other function call. GSL library being used for solving ODEs, requires
+ //function containing odes in specific format which is differnt than generated
+ //above.
+ for counterin = 1:NInArg
+
+ //if((NInArg == 4 & counterin <> 3) | (NInArg == 5 & counterin <> 4)) //Skip third argument
+ if (InArg(counterin).Type == 'g' & InArg(counterin).Scope == 'String')
+ TmpInArgName = '""'+InArg(counterin).Name+'""';
+ elseif (InArg(counterin).Type == 'z' & (InArg(counterin).Scope == 'Number'))
+ TmpInArgName = 'DoubleComplex('+SCI2Cstring(real(InArg(counterin).Value))+','+SCI2Cstring(imag(InArg(counterin).Value))+')';
+ elseif (InArg(counterin).Type == 'c' & (InArg(counterin).Scope == 'Number'))
+ TmpInArgName = 'FloatComplex('+SCI2Cstring(real(InArg(counterin).Value))+','+SCI2Cstring(imag(InArg(counterin).Value))+')';
+ else
+ TmpInArgName = InArg(counterin).Name;
+ end
+
+ TmpInArgType = C_Type(InArg(counterin).Type);
+
+ //if (FunctionName == 'OpEqual')
+ // TmpInArgSizeVar = '__'+OutArg(counterin).Name+'Size';
+ // else
+ TmpInArgSizeVar = '__'+InArg(counterin).Name+'Size';
+ //end
+
+ if (InArg(counterin).Dimension == 0)
+ if (FlagCall == 0)
+ CCall = CCall+TmpInArgType+' ';
+ end
+ CCall = CCall+TmpInArgName+',';
+ else
+ if (FlagCall == 0)
+ CCall = CCall+TmpInArgType+'* '+TmpInArgName+', ';//int* __'+TmpInArgName+'Size,';
+ else
+ CCall = CCall+TmpInArgName+', ';//+TmpInArgSizeVar+',';
+ end
+ end
+ //end
+ end
+
+ end
+
+ // #RNU_RES_B
+ PrintStringInfo(' C call after input args analysis: '+CCall,ReportFileName,'file','y');
+ // #RNU_RES_E
+ for counterout = 1:NOutArg
+ TmpOutArgName = OutArg(counterout).Name;
+ TmpOutArgType = C_Type(OutArg(counterout).Type);
+ if (counterout == PosFirstOutScalar)
if (FlagCall == 0)
+ // #RNU_RES_B
// --- Write in the declaration file the returned output scalar (if any). ---
+ // #RNU_RES_E
outscalardeclaration = TmpOutArgType+' '+TmpOutArgName+';';
+ // #RNU_RES_B
PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
+ // #RNU_RES_E
PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CDeclarationFileName,'file','y');
PrintStringInfo(' ',CDeclarationFileName,'file','y');
- CCall = CCall+TmpOutArgType+'* __ptr'+TmpOutArgName+', ';
- else
- CCall = CCall+'&'+TmpOutArgName+', ';//NUT: verifica se ci vuole l'&
end
else
- if (FlagCall == 0)
- CCall = CCall+TmpOutArgType+'* '+TmpOutArgName+',';
- if (OutArg(counterout).FindLike == 1)
- CCall = CCall+'int* __'+TmpOutArgName+'Size'+',';
+ if (OutArg(counterout).Dimension == 0)
+ if (FlagCall == 0)
+ // --- Write in the declaration file the returned output scalar (if any). ---
+ outscalardeclaration = TmpOutArgType+' '+TmpOutArgName+';';
+ PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
+ PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CDeclarationFileName,'file','y');
+ PrintStringInfo(' ',CDeclarationFileName,'file','y');
+ CCall = CCall+TmpOutArgType+'* __ptr'+TmpOutArgName+', ';
+ else
+ CCall = CCall+'&'+TmpOutArgName+', ';//NUT: verifica se ci vuole l'&
end
- // #RNU_RES_B
- //NUT prova a sostituire le variabili strutture con variabili dichiarate all'inizio del codice.
- // --- Declare the size of the output arguments. ---
- // #RNU_RES_E
- outscalardeclaration = 'int __'+TmpOutArgName+'Size[2];';
- PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
- PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CDeclarationFileName,'file','y');
- outscalardeclaration = '__'+TmpOutArgName+'Size[0] = '+(OutArg(counterout).Size(1))+';';
- PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
- PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CInitVarsFileName,'file','y');
- outscalardeclaration = '__'+TmpOutArgName+'Size[1] = '+(OutArg(counterout).Size(2))+';';
- PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
- PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CInitVarsFileName,'file','y');
- PrintStringInfo(' ',CInitVarsFileName,'file','y');
else
- CCall = CCall+OutArg(counterout).Name+',';
- if (OutArg(counterout).FindLike == 1)
- CCall = CCall+'(int* ) __'+TmpOutArgName+'Size'+',';
+ if (FlagCall == 0)
+ CCall = CCall+TmpOutArgType+'* '+TmpOutArgName+',';
+ if (OutArg(counterout).FindLike == 1)
+ CCall = CCall+'int* __'+TmpOutArgName+'Size'+',';
+ end
+ // #RNU_RES_B
+ //NUT prova a sostituire le variabili strutture con variabili dichiarate all'inizio del codice.
+ // --- Declare the size of the output arguments. ---
+ // #RNU_RES_E
+ outscalardeclaration = 'int __'+TmpOutArgName+'Size[2];';
+ PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
+ PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CDeclarationFileName,'file','y');
+ outscalardeclaration = '__'+TmpOutArgName+'Size[0] = '+(OutArg(counterout).Size(1))+';';
+ PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
+ PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CInitVarsFileName,'file','y');
+ outscalardeclaration = '__'+TmpOutArgName+'Size[1] = '+(OutArg(counterout).Size(2))+';';
+ PrintStringInfo(outscalardeclaration,ReportFileName,'file','y');
+ PrintStringInfo(C_IndentBlanks(1)+outscalardeclaration,CInitVarsFileName,'file','y');
+ PrintStringInfo(' ',CInitVarsFileName,'file','y');
+ else
+ CCall = CCall+OutArg(counterout).Name+',';
+ if (OutArg(counterout).FindLike == 1)
+ CCall = CCall+'(int* ) __'+TmpOutArgName+'Size'+',';
+ end
end
end
end
end
-end
-PrintStringInfo(' C call after output args analysis: '+CCall,ReportFileName,'file','y');
-// Remove the last " " and ","
-if (part(CCall,length(CCall):length(CCall)) == ' ')
- CCall = part(CCall,1:length(CCall)-1);
-end
-if (part(CCall,length(CCall):length(CCall)) == ',')
- CCall = part(CCall,1:length(CCall)-1);
-end
+ PrintStringInfo(' C call after output args analysis: '+CCall,ReportFileName,'file','y');
+ // Remove the last " " and ","
+ if (part(CCall,length(CCall):length(CCall)) == ' ')
+ CCall = part(CCall,1:length(CCall)-1);
+ end
+ if (part(CCall,length(CCall):length(CCall)) == ',')
+ CCall = part(CCall,1:length(CCall)-1);
+ end
-//__ysize is added to input arguments at last to comply with form required by GSL
-if(mtlb_strcmp(part(CFunName,1:5),'odefn') == %T)
- CCall = CCall + ', int* '+TmpInArgSizeVar;
-end
+ //__ysize is added to input arguments at last to comply with form required by GSL
+ if(mtlb_strcmp(part(CFunName,1:5),'odefn') == %T)
+ CCall = CCall + ', int* '+TmpInArgSizeVar;
+ end
-CCall = CCall+')';
-if (FlagCall == 1)
- CCall = CCall+';';
-end
+ CCall = CCall+')';
+ if (FlagCall == 1)
+ CCall = CCall+';';
+ end
+
+end
//NUT: la parte di generazione della C call va inserita in una funzione a parte.
//NUT: tale funzione deve avere anche uno switch che consenta di generare differenti versioni
//NUT: delle chiamate C in accordo con la libreria disponibile, fermo restando che
diff --git a/macros/CCodeGeneration/C_GenerateFunName.bin b/macros/CCodeGeneration/C_GenerateFunName.bin
index 8486a3b..1b723f1 100644
--- a/macros/CCodeGeneration/C_GenerateFunName.bin
+++ b/macros/CCodeGeneration/C_GenerateFunName.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci
index d87fb9c..a1373de 100644
--- a/macros/CCodeGeneration/C_GenerateFunName.sci
+++ b/macros/CCodeGeneration/C_GenerateFunName.sci
@@ -24,10 +24,13 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg)
SCI2CNInArgCheck(argn(2),5,5);
CFunName = '';
if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName)) | ...
- (mtlb_strcmp(part(FunctionName,1:5),'odefn') == %T))
+ (mtlb_strcmp(part(FunctionName,1:5),'odefn') == %T) |...
+ (mtlb_strcmp(part(FunctionName,1:9),'PI_thread') == %T)| ...
+ (mtlb_strcmp(part(FunctionName,1:4),'ISR_') == %T))
//If current function is an AVR or RPi function, then function name can be just
//plain function name without any input/output arguments types
-
+//Slimilarly for functions conataining ode functions and functions to be called in
+//separate thread in RPi
CFunName = CFunName+FunctionName;
else
diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin
index 4b3546e..5a095f4 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.bin
+++ b/macros/CCodeGeneration/C_GenerateMakefile.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci
index b1c1e71..29e8a08 100644
--- a/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -70,14 +70,16 @@ else
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');
+ PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lwiringPi',FileInfo.MakefileFilename,'file','y','y');
else
PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y');
end
end
//If ode function is used, add libgsl.
-if(size(SharedInfo.ODElist) <> 0)
+if(size(SharedInfo.Includelist) <> 0)
+ if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
PrintStringInfo('LDFLAGS += -lgsl',FileInfo.MakefileFilename,'file','y','y');
+ end
end
// Binary definition
@@ -95,8 +97,10 @@ for i = 1:(nbSources(1) - 1)
[tmppath,tmpfile,tmpext] = fileparts(allSources(i));
if(~isempty(strstr(allSources(i),'ode')))
- if(size(SharedInfo.ODElist) <> 0)
- PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+ if(size(SharedInfo.Includelist) <> 0)
+ if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+ PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
+ end
end
else
PrintStringInfo(' $(CSRCDIR)/'+tmpfile+tmpext+' \\', FileInfo.MakefileFilename,'file','y','y');
diff --git a/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin
index 18e0a1b..f9bad33 100644
--- a/macros/CCodeGeneration/C_Type.bin
+++ b/macros/CCodeGeneration/C_Type.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_Type.sci b/macros/CCodeGeneration/C_Type.sci
index 6e9a295..3c56b71 100644
--- a/macros/CCodeGeneration/C_Type.sci
+++ b/macros/CCodeGeneration/C_Type.sci
@@ -43,6 +43,10 @@ elseif (ArgType == 'u16')
OutC_Type = 'uint16';
elseif (ArgType == 'i16')
OutC_Type = 'int16';
+elseif (ArgType == 'u32')
+ OutC_Type = 'uint32';
+elseif (ArgType == 'i32')
+ OutC_Type = 'int32';
elseif (ArgType == 'fn') //This type introduced for ODE function,
// as it's one of the inout argument is name of the other function
OutC_Type = '';
diff --git a/macros/CCodeGeneration/JoinDeclarAndCcode.bin b/macros/CCodeGeneration/JoinDeclarAndCcode.bin
index a818143..084ab08 100644
--- a/macros/CCodeGeneration/JoinDeclarAndCcode.bin
+++ b/macros/CCodeGeneration/JoinDeclarAndCcode.bin
Binary files differ
diff --git a/macros/CCodeGeneration/JoinDeclarAndCcode.sci b/macros/CCodeGeneration/JoinDeclarAndCcode.sci
index 4328895..2c69f46 100644
--- a/macros/CCodeGeneration/JoinDeclarAndCcode.sci
+++ b/macros/CCodeGeneration/JoinDeclarAndCcode.sci
@@ -146,9 +146,9 @@ PrintStringInfo('** --- C code. ---',CPass2FileName,'file','y');
PrintStringInfo('** ---------------',CPass2FileName,'file','y');
PrintStringInfo('*/',CPass2FileName,'file','y');
-if(SharedInfo.Target == "RPi")
- //Add bcm2835_init() function as it is required
- PrintStringInfo('bcm2835_init();',CPass2FileName,'file','y');
+if((SharedInfo.Target == "RPi") & (nxtscifunname == SharedInfo.SCIMainFunName))
+ //Add wiringPiSetup() function as it is required
+ PrintStringInfo('wiringPiSetup();',CPass2FileName,'file','y');
end
// --- Copy the remaining part of V1 in V2. ---
while (~meof(CPass1V1FileFid))
diff --git a/macros/FunctionAnnotation/FA_GetOutArgInfo.bin b/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
index 7102319..2b75b7a 100644
--- a/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
+++ b/macros/FunctionAnnotation/FA_GetOutArgInfo.bin
Binary files differ
diff --git a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci b/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
index 314c0f2..d9696c8 100644
--- a/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
+++ b/macros/FunctionAnnotation/FA_GetOutArgInfo.sci
@@ -69,6 +69,7 @@ for counterin = 1:NInArg
flagfindlike = -1;
end
end
+
for counterout = 1:NOutArg
if(FunTypeAnnot == 'FA_TP_USER')
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 545334a..960068e 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index 61bb6c0..fe4edb1 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -16,6 +16,20 @@ RPiSupportFunctions = [
"RPI_DigitalOut"
"RPI_DigitalSetup"
"RPI_DelayMilli"
- "RPI_DelayMicro"];
+ "RPI_DelayMicro"
+ "RPI_GetMillis"
+ "RPI_GetMicros"
+ "RPI_SerialSetup"
+ "RPI_SerialClose"
+ "RPI_SerialSendChar"
+ "RPI_SerialFlush"
+ "RPI_SerialGetChar"
+ "RPI_ThreadCreate"
+ "RPI_PinISR"
+ ];
+
+//Note: "RPI_SerialSendData" is removed since distinction between input data
+//types is required
+
endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
new file mode 100644
index 0000000..3e6c08f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
new file mode 100644
index 0000000..7f825ef
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
@@ -0,0 +1,31 @@
+function Micros = RPI_GetMicros()
+// Function to get time in Microsecond since first setup function called.
+//
+// Calling Sequence
+// Micros = RPI_GetMicros()
+//
+// Parameters
+// Micros: time in Microseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMicros()
+// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMicros()
+// delay = end- start //This should be approximately 1000 us.
+//
+// See also
+// RPI_GetMillis RPI_DelayMilli 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.
+Micros = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
new file mode 100644
index 0000000..b914365
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
new file mode 100644
index 0000000..b83f5fe
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
@@ -0,0 +1,31 @@
+function Millis = RPI_GetMillis()
+// Function to get time in millisecond since first setup function called.
+//
+// Calling Sequence
+// Millis = RPI_GetMillis()
+//
+// Parameters
+// Millis: time in milliseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMillis()
+// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMillis()
+// delay = end- start //This should be approximately 100ms.
+//
+// See also
+// RPI_GetMicros RPI_DelayMilli 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.
+Millis = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
new file mode 100644
index 0000000..a6c0bd9
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_PinISR.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
new file mode 100644
index 0000000..2de7d9e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_PinISR.sci
@@ -0,0 +1,47 @@
+function RPI_PinISR(pin, edgetype, fn)
+// Function to assign a function to be run when an interrupt occurs on
+// specified pin.
+//
+// Calling Sequence
+// RPI_PinISR(pin, edgetype, fn)
+//
+// Parameters
+// pin : pin whose interrupt is to be configured
+// edgetype: edge on which interrupt is to be monitored
+// 1 -> Falling egde
+// 2 -> Rising egde
+// 3 -> Both egde
+// fn: name of the function to be executed on interrupt occurance
+// Description
+// This functions monitors interrupt on specified pin for specified edge,
+// When that interrupt occurs, function specified by 'fn' is executed.
+// Examples
+// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
+// pin 12
+// See also
+// RPI_ThreadCreate RPI_DigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+EdgeTypeSupported = members(edgetype,[1 2 3])
+
+if(EdgeTypeSupported == 0)
+ error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
+end
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
new file mode 100644
index 0000000..dce972d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
new file mode 100644
index 0000000..0d393f3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
@@ -0,0 +1,25 @@
+function RPI_SerialClose(fd)
+// Function to close serial port specified by file descriptor.
+//
+// Calling Sequence
+// RPI_SerialClose(fd)
+//
+// Parameters
+// fd : file descriptor for opened port
+// Description
+// This functions closes the specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialClose(serial1)
+// See also
+// RPI_SerialOpen RPI_SerialSendChar
+//
+//
+// 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_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
new file mode 100644
index 0000000..2a3704d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
new file mode 100644
index 0000000..ffef70b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
@@ -0,0 +1,26 @@
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// RPI_SerialFlush(serial);
+// bytes = RPI_SerialDataAvail(serial);
+//
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// 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_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
new file mode 100644
index 0000000..9e6dd09
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
new file mode 100644
index 0000000..ce17ea8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -0,0 +1,28 @@
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// bytes = RPI_SerialDataAvail(serial);
+// if(bytes>0)
+// data = RPI_SerialGetChar(serial) //Reads single character
+// end
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+data = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
new file mode 100644
index 0000000..7614ebc
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
new file mode 100644
index 0000000..82051d6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
@@ -0,0 +1,29 @@
+function RPI_SerialSendChar(fd, data)
+// Function to send 8-bit char through serial port.
+//
+// Calling Sequence
+// RPI_SerialSendChar(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: 8-bit character data to be sent
+// Description
+// This functions sends input 8-bit character data on specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendChar(serial1, 'H');
+// RPI_SerialSendChar(serial1, 'i');
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
new file mode 100644
index 0000000..a3524a6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
new file mode 100644
index 0000000..6bfe80d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
@@ -0,0 +1,30 @@
+function RPI_SerialSendData(fd, data)
+// Function to send data through serial port. Data can be of any datatype and
+// can be scalar or matrix
+//
+// Calling Sequence
+// RPI_SerialSendData(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: data to be sent
+// Description
+// This functions sends input data on specified serial port
+// Examples
+// A = [2 3; 4 5]
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendData(serial1, A);
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
new file mode 100644
index 0000000..0128c27
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
new file mode 100644
index 0000000..25a70a3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
@@ -0,0 +1,28 @@
+function fd = RPI_SerialSetup(port, baudrate)
+// Function to setup serial port.
+//
+// Calling Sequence
+// RPI_SerialSetup(port, baudrate)
+//
+// Parameters
+// port : port of RPi to be used (eg. )
+// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// fd : file descriptor for opened port, -1 for error
+// Description
+// This functions opens the specified serial port and returns file descriptor
+// for the same
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+//
+// See also
+// RPI_SerialClose RPI_SerialSendChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+fd = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 1031744..40a6b04 100644
--- a/macros/Hardware/RasberryPi/lib
+++ b/macros/Hardware/RasberryPi/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
index 138ac2a..a97a189 100644
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -5,3 +5,13 @@ RPI_DelayMilli
RPI_DigitalIn
RPI_DigitalOut
RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
new file mode 100644
index 0000000..3789bd6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
new file mode 100644
index 0000000..5a29156
--- /dev/null
+++ b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
@@ -0,0 +1,29 @@
+function bytes = RPI_SerialDataAvail(fd)
+// Function to get number of data bytes available on serial port specified by
+// file descriptor
+// Calling Sequence
+// RPI_SerialDataAvail(fd)
+//
+// Parameters
+// fd : file descriptor for already opened serial port
+// Description
+// This functions returns number of characters available to read,
+// otherwise reads -1 in case of error. This function can be used to check
+// new data is available on serial port
+// Examples
+// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
+// charsToRead = RPI_SerialDataAvail(serial);
+// See also
+// RPI_SerialOpen RPI_SerialGetChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+bytes = 0;
+
+endfunction \ No newline at end of file
diff --git a/macros/SymbolTable/ST_GetInArgInfo.bin b/macros/SymbolTable/ST_GetInArgInfo.bin
index bb7119a..1c5fe7c 100644
--- a/macros/SymbolTable/ST_GetInArgInfo.bin
+++ b/macros/SymbolTable/ST_GetInArgInfo.bin
Binary files differ
diff --git a/macros/SymbolTable/ST_GetInArgInfo.sci b/macros/SymbolTable/ST_GetInArgInfo.sci
index 72e96dd..03b067a 100644
--- a/macros/SymbolTable/ST_GetInArgInfo.sci
+++ b/macros/SymbolTable/ST_GetInArgInfo.sci
@@ -154,7 +154,27 @@ for cntinarg = 1:NInArg
UpdatedInArg(cntinarg).Scope = 'Temp';
ST_InsOutArg(UpdatedInArg(cntinarg),1,FileInfo,SharedInfo,'all');
end
- else
+ elseif (ASTFunName == 'RPI_ThreadCreate')
+ UpdatedInArg(cntinarg).Name = tmpname; // Change the name.
+ UpdatedInArg(cntinarg).Type = 'fn'; //it is a function name
+ UpdatedInArg(cntinarg).Size(1) = '1';
+ UpdatedInArg(cntinarg).Size(2) = '1'; //+1 = (\0)
+ UpdatedInArg(cntinarg).Value = '&'+tmpname;
+ UpdatedInArg(cntinarg).FindLike = 0;
+ UpdatedInArg(cntinarg).Dimension = 0; //NUT: in future releases you can set this field to 1.
+ UpdatedInArg(cntinarg).Scope = 'Temp';
+ ST_InsOutArg(UpdatedInArg(cntinarg),1,FileInfo,SharedInfo,'all');
+ elseif (ASTFunName == 'RPI_PinISR')
+ UpdatedInArg(cntinarg).Name = tmpname; // Change the name.
+ UpdatedInArg(cntinarg).Type = 'fn'; //it is a function name
+ UpdatedInArg(cntinarg).Size(1) = '1';
+ UpdatedInArg(cntinarg).Size(2) = '1'; //+1 = (\0)
+ UpdatedInArg(cntinarg).Value = '&'+tmpname;
+ UpdatedInArg(cntinarg).FindLike = 0;
+ UpdatedInArg(cntinarg).Dimension = 0; //NUT: in future releases you can set this field to 1.
+ UpdatedInArg(cntinarg).Scope = 'Temp';
+ ST_InsOutArg(UpdatedInArg(cntinarg),1,FileInfo,SharedInfo,'all');
+ else
PrintStringInfo(' ',ReportFileName,'both','y');
PrintStringInfo('SCI2CERROR: Unknown symbol ""'+tmpname+'"".',ReportFileName,'both','y');
PrintStringInfo('SCI2CERROR: Be sure to initialize every symbol you are using.',ReportFileName,'both','y');
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
index 6da0f76..f9c8482 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
Binary files differ
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 1e0d67a..72652e0 100644
--- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -4785,7 +4785,7 @@ 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. ---
@@ -4810,7 +4810,7 @@ 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. ---
@@ -4835,7 +4835,7 @@ 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. ---
@@ -4850,6 +4850,208 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
+//---- Class RPI_GetMilli ----------
+//------------------------------------
+ClassName = 'RPI_GetMilli';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 0',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u32''',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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_GetMillis';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_GetMicros';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_SetupSerial ----------
+//------------------------------------
+ClassName = 'RPI_SetupSerial';
+
+// --- 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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_SerialSetup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_SetupClose ----------
+//------------------------------------
+ClassName = 'RPI_SetupClose';
+
+// --- 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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_SerialClose';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_SerialFlush';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_SerialSendData ----------
+//------------------------------------
+ClassName = 'RPI_SerialSendData';
+
+// --- 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('u80u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80i80'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80u160'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80i160'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80s0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+PrintStringInfo('u80u82'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80i82'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80u162'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80i162'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80s2'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80d2'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('u80g2'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_SerialSendData';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_SerialDataAvail ----------
+//------------------------------------
+ClassName = 'RPI_SerialDataAvail';
+
+// --- 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= ''i16''',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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_SerialDataAvail';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_SerialGetChar';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
+//---- Class RPI_ThreadCreate ----------
+//------------------------------------
+ClassName = 'RPI_ThreadCreate';
+
+// --- 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= ''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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_ThreadCreate';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_PinISR --------------
+//------------------------------------
+ClassName = 'RPI_PinISR';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''i16''',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(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_PinISR';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
//---- Class ODE ---------------------
//------------------------------------
ClassName = 'ODE';
diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.bin b/macros/ToolInitialization/INIT_GenSharedInfo.bin
index c718288..f0955c3 100644
--- a/macros/ToolInitialization/INIT_GenSharedInfo.bin
+++ b/macros/ToolInitialization/INIT_GenSharedInfo.bin
Binary files differ
diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.sci b/macros/ToolInitialization/INIT_GenSharedInfo.sci
index bee68d1..2aeec08 100644
--- a/macros/ToolInitialization/INIT_GenSharedInfo.sci
+++ b/macros/ToolInitialization/INIT_GenSharedInfo.sci
@@ -128,7 +128,7 @@ SharedInfo.ResizeApproach = 'NO_RESIZE'; // 'NO_RESIZE', 'RESIZE_ALL', 'RESIZE_T
SharedInfo.Target = Target; // Specifies code generation target.
-SharedInfo.ODElist = list(); //Maintains list of ode functions being used in code
- // to add their header files to main function.
+SharedInfo.Includelist = list(); //Maintains list of functions being used in code
+ // to add their header files to main function.
endfunction
diff --git a/macros/findDeps/getAllHeaders.bin b/macros/findDeps/getAllHeaders.bin
index d44f5f2..b7773ac 100644
--- a/macros/findDeps/getAllHeaders.bin
+++ b/macros/findDeps/getAllHeaders.bin
Binary files differ
diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci
index be13035..71b8b20 100644
--- a/macros/findDeps/getAllHeaders.sci
+++ b/macros/findDeps/getAllHeaders.sci
@@ -169,9 +169,13 @@ function allHeaders = getAllHeaders(Target)
];
RPi_headers = [
- "includes/bcm2835.h"
+ "src/c/hardware/rasberrypi/libraries/wiringPi/wiringPi.h"
+ "src/c/hardware/rasberrypi/libraries/wiringPi/wiringSerial.h"
"src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h"
- "src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h"
+ "src/c/hardware/rasberrypi/includes/RPIPeripheralTiming.h"
+ "src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h"
+ "src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h"
+ "src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h"
];
if Target == "StandAlone"
diff --git a/macros/findDeps/getAllInterfaces.bin b/macros/findDeps/getAllInterfaces.bin
index 6315795..3558d2c 100644
--- a/macros/findDeps/getAllInterfaces.bin
+++ b/macros/findDeps/getAllInterfaces.bin
Binary files differ
diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci
index 6928831..9d86180 100644
--- a/macros/findDeps/getAllInterfaces.sci
+++ b/macros/findDeps/getAllInterfaces.sci
@@ -163,9 +163,11 @@ function allInterfaces = getAllInterfaces(Target)
RPI_interfaces = [
"src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h"
- "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h"
-
-];
+ "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h"
+ "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h"
+ "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralThreading.h"
+ "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinISR.h"
+ ];
if Target == "StandAlone"
allInterfaces = Standalone_interfaces;
diff --git a/macros/findDeps/getAllLibraries.bin b/macros/findDeps/getAllLibraries.bin
index 8157de9..7828cd2 100644
--- a/macros/findDeps/getAllLibraries.bin
+++ b/macros/findDeps/getAllLibraries.bin
Binary files differ
diff --git a/macros/findDeps/getAllLibraries.sci b/macros/findDeps/getAllLibraries.sci
index 57cc9da..7741caf 100644
--- a/macros/findDeps/getAllLibraries.sci
+++ b/macros/findDeps/getAllLibraries.sci
@@ -3,7 +3,7 @@ function allLibraries = getAllLibraries(Target)
//Library files required for "RasberryPi" target
RPi_libs = [
- "src/c/hardware/rasberrypi/libraries/libbcm2835.a"
+ "src/c/hardware/rasberrypi/libraries/wiringPi/libwiringPi.so"
"src/c/hardware/rasberrypi/libraries/libcblas.a"
"src/c/hardware/rasberrypi/libraries/librefblas.a"
"src/c/hardware/rasberrypi/libraries/liblapack.a"
diff --git a/macros/findDeps/getAllSources.bin b/macros/findDeps/getAllSources.bin
index 2fcad7e..5f60ac9 100644
--- a/macros/findDeps/getAllSources.bin
+++ b/macros/findDeps/getAllSources.bin
Binary files differ
diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci
index 050c0d6..84975fc 100644
--- a/macros/findDeps/getAllSources.sci
+++ b/macros/findDeps/getAllSources.sci
@@ -1005,10 +1005,32 @@ function allSources = getAllSources(Target)
"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"
-
-];
+ "src/c/hardware/rasberrypi/timing/u16RPIDelayMillis.c"
+ "src/c/hardware/rasberrypi/timing/u16RPIDelayMicros.c"
+ "src/c/hardware/rasberrypi/timing/u32RPIGetMillis.c"
+ "src/c/hardware/rasberrypi/timing/u32RPIGetMicros.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialSetups.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialCloses.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialSendChars.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/i8RPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/u16RPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/i16RPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/i8RPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/u16RPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/i16RPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/sRPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/dRPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/sRPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/dRPISerialSendDataa.c"
+ "src/c/hardware/rasberrypi/serial/gRPISerialSendDatas.c"
+ "src/c/hardware/rasberrypi/serial/i16RPISerialDataAvails.c"
+ "src/c/hardware/rasberrypi/serial/i16RPISerialGetChars.c"
+ "src/c/hardware/rasberrypi/serial/u8RPISerialFlushs.c"
+ "src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c"
+ "src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c"
+ ];
if Target == "StandAlone"
allSources = Standalone_files;
diff --git a/macros/runsci2c.bin b/macros/runsci2c.bin
index 47f5ccd..e3770d0 100644
--- a/macros/runsci2c.bin
+++ b/macros/runsci2c.bin
Binary files differ
diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci
index 7dae72a..5efca90 100644
--- a/macros/runsci2c.sci
+++ b/macros/runsci2c.sci
@@ -116,8 +116,10 @@ for i = 1:size(allSources, "*")
//disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
//Copy ode related functions only if 'ode' function is used.
if(~isempty(strstr(allSources(i),'ode')))
- if(size(SharedInfo.ODElist) <> 0)
- copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ if(size(SharedInfo.Includelist) <> 0)
+ if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
+ copyfile(allSources(i), SCI2COutputPath+"/src/c/");
+ end
end
else
copyfile(allSources(i), SCI2COutputPath+"/src/c/");
diff --git a/macros/scilab2c.bin b/macros/scilab2c.bin
index 270d1d5..43191d5 100644
--- a/macros/scilab2c.bin
+++ b/macros/scilab2c.bin
Binary files differ
diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci
index 19b1f2b..8bdb667 100644
--- a/macros/scilab2c.sci
+++ b/macros/scilab2c.sci
@@ -12,7 +12,6 @@
function scilab2c(varargin)
[lhs, rhs] = argn();
-
select rhs
//
// scilab2c()
@@ -144,7 +143,7 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"),
// --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! ---
// If Target choosen is 'Standalone' then only execute the code, otherwise directly start conversion.
- if ((Target == "StandAlone") | (Target == "RPi"))
+ if ((Target == "StandAlone"))// | (Target == "RPi"))
runscicode(UserScilabMainFile, UserSciFilesPaths);
// --- ASK USER FOR CONTINUATION. ---