diff options
Diffstat (limited to '2.3-1/macros')
-rw-r--r-- | 2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin | bin | 5444 -> 6288 bytes | |||
-rw-r--r-- | 2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci | 36 | ||||
-rw-r--r-- | 2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin | bin | 3552 -> 3480 bytes | |||
-rw-r--r-- | 2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci | 2 | ||||
-rw-r--r-- | 2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci | 31 | ||||
-rw-r--r-- | 2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin | bin | 1256 -> 1888 bytes | |||
-rw-r--r-- | 2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci | 11 | ||||
-rw-r--r-- | 2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci | 2 | ||||
-rw-r--r-- | 2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin | bin | 950836 -> 951340 bytes | |||
-rw-r--r-- | 2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci | 8 | ||||
-rw-r--r-- | 2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci | 7 | ||||
-rw-r--r-- | 2.3-1/macros/findDeps/getAllInterfaces.sci | 2 |
12 files changed, 76 insertions, 23 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin Binary files differindex 6551c7f7..4f3c5917 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci index 9d40d2b9..657258a9 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,22 +23,30 @@ 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 -for tmpcnt = 1:NInArg - if (InArg(tmpcnt).Dimension == 1) - CFunName = CFunName+InArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); - end -end + CFunName = CFunName+FunctionName; + +else + + for tmpcnt = 1:NInArg + if (InArg(tmpcnt).Dimension == 1) + CFunName = CFunName+InArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); + end + end -CFunName = CFunName+FunctionName; + CFunName = CFunName+FunctionName; -for tmpcnt = 1:NOutArg - if (OutArg(tmpcnt).Dimension == 1) - CFunName = CFunName+OutArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); - end + for tmpcnt = 1:NOutArg + if (OutArg(tmpcnt).Dimension == 1) + CFunName = CFunName+OutArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); + end + end end endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin Binary files differindex 65e8f454..4a49b861 100644 --- a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin +++ b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci index 6316cdd7..1529c347 100644 --- a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci +++ b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci @@ -6,7 +6,7 @@ function AVRTimerSetup(timer, prescalar) // // Parameters // timer: timer to be set up (0,1,2) -// prescalar: prescalar to be used for generating PWM waveform (0-7) +// prescalar: prescalar to be used for timer (0-7) // ***Refer datasheet for more description about timer // // Description diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci new file mode 100644 index 00000000..1529c347 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci @@ -0,0 +1,31 @@ +function AVRTimerSetup(timer, prescalar) +// Function to set the prescalar for timer. +// +// Calling Sequence +// AVRTimerSetup(timer, prescalar) +// +// Parameters +// timer: timer to be set up (0,1,2) +// prescalar: prescalar to be used for timer (0-7) +// ***Refer datasheet for more description about timer +// +// Description +// This function sets prescalr for timers. 'timer' decides which of the +// three (0,1,2) timers available to be used. The 'prescalar' is needed for +// deciding timer clock. Select appropriate prescalar depending on MCU clock +// and requirement. +// +// +// Examples +// AVRTimerSetup(0,1) //Timer 0 with no scaling +// +// See also +// AVRGetTimerValue +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin Binary files differindex eed8be3b..0aa7587f 100644 --- a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin +++ b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin diff --git a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci index 50a913fa..cce49f91 100644 --- a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci +++ b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci @@ -11,6 +11,15 @@ function AVRSupportFunctions = GetAVRSupportFunctions() // Author: Siddhesh Wani // ----------------------------------------------------------------- -AVRSupportFunctions = ["AVRDigitalOut"]; +AVRSupportFunctions = [ + "AVRADCSetup" + "AVRDigitalIn" + "AVRDigitalOut" + "AVRDigitalSetup" + "AVRGetTimerValue" + "AVRPWMSetDuty" + "AVRPWMSetup" + "AVRReadADC" + "AVRTimerSetup"]; endfunction diff --git a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci index db96e190..7322cead 100644 --- a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci +++ b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci @@ -4,7 +4,7 @@ SetupListFile = FileInfo.SetupListFile; load(SetupListFile,'SetupList'); -SetupArduinoFile = fullfile(FileInfo.CStyleOutCCCodeDir,'setup_arduino.c'); +SetupArduinoFile = fullfile(FileInfo.CStyleOutCCCodeDir,'setup_arduino.cpp'); C_SCI2CHeader(SetupArduinoFile); PrintStringInfo('#include ""setup_arduino.h""',SetupArduinoFile,'file','y'); diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex be0c48fb..26530399 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index aa783b1c..629b3ee8 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4267,8 +4267,8 @@ PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y'); // --- Function List Class. ---
ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo('d0d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
-
+//PrintStringInfo('d0d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'AVRPWMSetup';
@@ -4292,8 +4292,8 @@ 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('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'AVRPWMSetDuty';
diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci index 445507bb..253299a3 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci @@ -61,7 +61,12 @@ 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'); -FileInfo.Funct(funnumber).FinalCFileName = fullfile(FileInfo.OutCCCodeDir,SharedInfo.NextCFunName+'.c'); +if (SharedInfo.OutFormat == '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 + FileInfo.Funct(funnumber).FinalCFileName = fullfile(FileInfo.OutCCCodeDir,SharedInfo.NextCFunName+'.c'); +end FileInfo.Funct(funnumber).FinalHeaderFileName = fullfile(FileInfo.OutCCCodeDir,SharedInfo.NextCFunName+'.h'); FileInfo.Funct(funnumber).CInitVarsFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_initvars.c'); FileInfo.Funct(funnumber).CDeclarationFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_declarations.c'); diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 8b5df6f2..65ee1745 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -135,7 +135,7 @@ function allInterfaces = getAllInterfaces(OutFormat) AVR_interfaces = [ "src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h" "src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h" - "src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h" + "src/c/hardware/avr/interfaces/int_AVRPeripheralPWM.h" "src/c/hardware/avr/interfaces/int_AVRUtil.h" ]; |