diff options
author | siddhu8990 | 2015-12-17 14:48:36 +0530 |
---|---|---|
committer | siddhu8990 | 2015-12-23 11:26:29 +0530 |
commit | 329613eb48542f24bb9014a0a617b05199726e99 (patch) | |
tree | bf571563bb735fc2ccd9a300a952f8557667fd77 /macros/ToolInitialization | |
parent | 96b51a5ded447676d493be9721e4480065a5ae7e (diff) | |
download | Scilab2C_fossee_old-329613eb48542f24bb9014a0a617b05199726e99.tar.gz Scilab2C_fossee_old-329613eb48542f24bb9014a0a617b05199726e99.tar.bz2 Scilab2C_fossee_old-329613eb48542f24bb9014a0a617b05199726e99.zip |
Code generation for Arduino changed. DC motor added to Arduino.
Diffstat (limited to 'macros/ToolInitialization')
-rw-r--r-- | macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin | bin | 932856 -> 950836 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci | 101 | ||||
-rw-r--r-- | macros/ToolInitialization/INIT_GenFileInfo.bin | bin | 19356 -> 19628 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_GenFileInfo.sci | 2 | ||||
-rw-r--r-- | macros/ToolInitialization/INIT_LoadLibraries.bin | bin | 8844 -> 8940 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_LoadLibraries.sci | 2 | ||||
-rw-r--r-- | macros/ToolInitialization/INIT_SCI2C.bin | bin | 23840 -> 24408 bytes | |||
-rw-r--r-- | macros/ToolInitialization/INIT_SCI2C.sci | 9 | ||||
-rw-r--r-- | macros/ToolInitialization/ManageNextConversion.bin | bin | 11012 -> 11016 bytes | |||
-rw-r--r-- | macros/ToolInitialization/ManageNextConversion.sci | 1 |
10 files changed, 111 insertions, 4 deletions
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex f790c5e..be0c48f 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 c642353..c3981a4 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -3952,6 +3952,56 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
+//---- Class cmd_dcmotor_setup -------
+//------------------------------------
+ClassName = 'cmd_dcmotor_setup';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 5',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('d0d0d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_dcmotor_setup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class cmd_dcmotor_run -------
+//------------------------------------
+ClassName = 'cmd_dcmotor_run';
+
+// --- 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= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0i160'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'cmd_dcmotor_run';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+
+//------------------------------------
//---- Class Sleep -------------------
//------------------------------------
ClassName = 'sleep';
@@ -4109,6 +4159,57 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class AVRPWMSetup -------------
+//------------------------------------
+ClassName = 'AVRPWMSetup';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 4',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('d0d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'AVRPWMSetup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class AVRPWMSetDuty -----------
+//------------------------------------
+ClassName = 'AVRPWMSetDuty';
+
+// --- 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');
+
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'AVRPWMSetDuty';
+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_GenFileInfo.bin b/macros/ToolInitialization/INIT_GenFileInfo.bin Binary files differindex 8f114a7..a8d4722 100644 --- a/macros/ToolInitialization/INIT_GenFileInfo.bin +++ b/macros/ToolInitialization/INIT_GenFileInfo.bin diff --git a/macros/ToolInitialization/INIT_GenFileInfo.sci b/macros/ToolInitialization/INIT_GenFileInfo.sci index 753509e..21fe7a7 100644 --- a/macros/ToolInitialization/INIT_GenFileInfo.sci +++ b/macros/ToolInitialization/INIT_GenFileInfo.sci @@ -113,5 +113,5 @@ FileInfo.MakefileFilename = fullfile(FileInfo.CStyleOutCCCodeDir,'Makefile'); //----Hardware related-----
//-------------------------
FileInfo.PeripheralInitListFile = fullfile(FileInfo.WorkingDir,'PeripheralInit.dat');
-
+FileInfo.SetupListFile = fullfile(FileInfo.WorkingDir,'SetupList.dat');
endfunction
diff --git a/macros/ToolInitialization/INIT_LoadLibraries.bin b/macros/ToolInitialization/INIT_LoadLibraries.bin Binary files differindex 4cf0283..c85aac6 100644 --- a/macros/ToolInitialization/INIT_LoadLibraries.bin +++ b/macros/ToolInitialization/INIT_LoadLibraries.bin diff --git a/macros/ToolInitialization/INIT_LoadLibraries.sci b/macros/ToolInitialization/INIT_LoadLibraries.sci index 1ef9ee0..28eb34f 100644 --- a/macros/ToolInitialization/INIT_LoadLibraries.sci +++ b/macros/ToolInitialization/INIT_LoadLibraries.sci @@ -49,7 +49,7 @@ ToBeConverted(1).CFunctionName = SharedInfo.NextCFunName; // --- Read the list of library functions available. ---
[SCI2CAvailableC,SCI2CNElem] = FL_ExtractFuncList(FileInfo.SCI2CLibCFLFun,FileInfo.SCI2CLibCFLCls,...
SharedInfo.Annotations.FUNCLASS,SharedInfo.Extension.FuncListClasses,FileInfo.GeneralReport);
-
+//disp (SCI2CAvailable);
[USER2CAvailableC,USER2CNElem] = FL_ExtractFuncList(FileInfo.USER2CLibCFLFun,FileInfo.USER2CLibCFLCls,...
SharedInfo.Annotations.FUNCLASS,SharedInfo.Extension.FuncListClasses,FileInfo.GeneralReport);
diff --git a/macros/ToolInitialization/INIT_SCI2C.bin b/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex 72623b2..c6141d6 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 0340d6f..6dde05d 100644 --- a/macros/ToolInitialization/INIT_SCI2C.sci +++ b/macros/ToolInitialization/INIT_SCI2C.sci @@ -147,8 +147,13 @@ anscounter = 0; //--------------------------------------------
//---Hardware related initialisation----------
//--------------------------------------------
-PeripheralList = list();
-save(FileInfo.PeripheralInitListFile, 'PeripheralList');
+if (OutFormat == 'AVR')
+ PeripheralList = list();
+ save(FileInfo.PeripheralInitListFile, 'PeripheralList');
+elseif (OutFormat == 'Arduino')
+ SetupList = list();
+ save(FileInfo.SetupListFile, 'SetupList');
+end
endfunction
// #RNU_RES_B
diff --git a/macros/ToolInitialization/ManageNextConversion.bin b/macros/ToolInitialization/ManageNextConversion.bin Binary files differindex a34ee4f..bf43562 100644 --- a/macros/ToolInitialization/ManageNextConversion.bin +++ b/macros/ToolInitialization/ManageNextConversion.bin diff --git a/macros/ToolInitialization/ManageNextConversion.sci b/macros/ToolInitialization/ManageNextConversion.sci index 04ec9db..a152476 100644 --- a/macros/ToolInitialization/ManageNextConversion.sci +++ b/macros/ToolInitialization/ManageNextConversion.sci @@ -49,6 +49,7 @@ C_FinalizeCode(FileInfo,SharedInfo); // --- Identify the next function to translate. ---
// ------------------------------------------------
SharedInfo.NFilesToTranslate = SharedInfo.NFilesToTranslate - 1;
+
if (SharedInfo.NFilesToTranslate >= 1)
// Remove the translated C function from the ToBeConverted list
ToBeConverted(1) = [];
|