summaryrefslogtreecommitdiff
path: root/2.3-1/macros
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/macros')
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenerateFunName.binbin5444 -> 6288 bytes
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci36
-rw-r--r--2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci22
-rw-r--r--2.3-1/macros/Hardware/AVR/AVRTimerSetup.binbin3552 -> 3480 bytes
-rw-r--r--2.3-1/macros/Hardware/AVR/AVRTimerSetup.sci2
-rw-r--r--2.3-1/macros/Hardware/AVR/AVRUARTSetup.sci31
-rw-r--r--2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.binbin1256 -> 1888 bytes
-rw-r--r--2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci11
-rw-r--r--2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci3
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.binbin1000968 -> 0 bytes
-rw-r--r--2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci8
-rw-r--r--2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci7
-rw-r--r--2.3-1/macros/findDeps/getAllInterfaces.sci2
-rw-r--r--2.3-1/macros/runsci2c.sci1
14 files changed, 94 insertions, 29 deletions
diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin
index 6551c7f7..4f3c5917 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin
+++ b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin
Binary files differ
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/CCodeGeneration/C_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
index 320d8035..b998257a 100644
--- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
+++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci
@@ -1,3 +1,5 @@
+//Removed 4 lines code from end that causes ot generate the Makefile.mak file that is not needed with cygwin
+//Changed at line 52
function C_GenerateMakefile(FileInfo,SharedInfo)
// function C_GenerateMakefile(FileInfo,SharedInfo)
// -----------------------------------------------------------------
@@ -49,11 +51,19 @@ PrintStringInfo('HSRCDIR = '+makehsrcdir,FileInfo.MakefileFilename,'file','y
PrintStringInfo('ISRCDIR = '+makeisrcdir,FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('SCI2CDIR = .',FileInfo.MakefileFilename,'file','y','y');
-// Compiler definition
-PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
-PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y');
+if getos() == 'Windows' then
+ // Compiler definition
+ PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y');
+ PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
+ PrintStringInfo('LDFLAGS = -L./ -lblasplus -llapack -lm',FileInfo.MakefileFilename,'file','y','y'); //Added -L./ and -lblasplus(previously it was -lblas)
+
+else
+ // Compiler definition
+ PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y');
+ PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y');
+ PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y');
+end
// Binary definition
PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y');
@@ -107,8 +117,6 @@ PrintStringInfo('\t@echo ""==========================""',FileInfo.MakefileFilena
PrintStringInfo('\trm -rf $(EXEFILE)',FileInfo.MakefileFilename,'file','y','y');
PrintStringInfo('\t@echo "" ""',FileInfo.MakefileFilename,'file','y','y');
-if getos() == 'Windows' then
- C_GenerateMakefile_msvc(FileInfo,SharedInfo);
-end
+
endfunction
diff --git a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin
index 65e8f454..4a49b861 100644
--- a/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin
+++ b/2.3-1/macros/Hardware/AVR/AVRTimerSetup.bin
Binary files differ
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
index eed8be3b..0aa7587f 100644
--- a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin
+++ b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin
Binary files differ
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 416509c2..33a515d8 100644
--- a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci
+++ b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.sci
@@ -1,8 +1,11 @@
+//Scilab2C IITB FOSSEE
function GenerateSetupFunction(FileInfo)
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
deleted file mode 100644
index a92ebcf0..00000000
--- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin
+++ /dev/null
Binary files differ
diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
index 1f9b2c99..55c43ad2 100644
--- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
+++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci
@@ -4418,8 +4418,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';
@@ -4443,8 +4443,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 02e741cb..aa6776c8 100644
--- a/2.3-1/macros/findDeps/getAllInterfaces.sci
+++ b/2.3-1/macros/findDeps/getAllInterfaces.sci
@@ -136,7 +136,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"
];
diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci
index 4620705c..9d865894 100644
--- a/2.3-1/macros/runsci2c.sci
+++ b/2.3-1/macros/runsci2c.sci
@@ -151,6 +151,7 @@ else
if BuildTool == "make"
C_GenerateMakefile(FileInfo,SharedInfo);
+ copyBlasLapackLibs(FileInfo,SharedInfo); //Previously .dll files and blas,lapack library not creating for cygwin by additing this works fine
end
if BuildTool == "nmake"
copyBlasLapackLibs(FileInfo,SharedInfo);