From 329613eb48542f24bb9014a0a617b05199726e99 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Thu, 17 Dec 2015 14:48:36 +0530 Subject: Code generation for Arduino changed. DC motor added to Arduino. --- .../ToolInitialization/INIT_FillSCI2LibCDirs.bin | Bin 932856 -> 950836 bytes .../ToolInitialization/INIT_FillSCI2LibCDirs.sci | 101 +++++++++++++++++++++ macros/ToolInitialization/INIT_GenFileInfo.bin | Bin 19356 -> 19628 bytes macros/ToolInitialization/INIT_GenFileInfo.sci | 2 +- macros/ToolInitialization/INIT_LoadLibraries.bin | Bin 8844 -> 8940 bytes macros/ToolInitialization/INIT_LoadLibraries.sci | 2 +- macros/ToolInitialization/INIT_SCI2C.bin | Bin 23840 -> 24408 bytes macros/ToolInitialization/INIT_SCI2C.sci | 9 +- macros/ToolInitialization/ManageNextConversion.bin | Bin 11012 -> 11016 bytes macros/ToolInitialization/ManageNextConversion.sci | 1 + 10 files changed, 111 insertions(+), 4 deletions(-) (limited to 'macros/ToolInitialization') diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin index f790c5e..be0c48f 100644 Binary files a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin and b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin differ 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 @@ -3951,6 +3951,56 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun); +//------------------------------------ +//---- 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 ------------------- //------------------------------------ @@ -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 index 8f114a7..a8d4722 100644 Binary files a/macros/ToolInitialization/INIT_GenFileInfo.bin and b/macros/ToolInitialization/INIT_GenFileInfo.bin differ 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 index 4cf0283..c85aac6 100644 Binary files a/macros/ToolInitialization/INIT_LoadLibraries.bin and b/macros/ToolInitialization/INIT_LoadLibraries.bin differ 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 index 72623b2..c6141d6 100644 Binary files a/macros/ToolInitialization/INIT_SCI2C.bin and b/macros/ToolInitialization/INIT_SCI2C.bin differ 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 index a34ee4f..bf43562 100644 Binary files a/macros/ToolInitialization/ManageNextConversion.bin and b/macros/ToolInitialization/ManageNextConversion.bin differ 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) = []; -- cgit