diff options
181 files changed, 1612 insertions, 346 deletions
diff --git a/etc/scilab2c.start b/etc/scilab2c.start index 604b5fe..07a95e1 100644 --- a/etc/scilab2c.start +++ b/etc/scilab2c.start @@ -23,6 +23,8 @@ sci2c_finDeps = lib(pathmacros + "findDeps" + filesep()); sci2c_AVRlib = lib(pathmacros + "Hardware\AVR" + filesep()); sci2c_RPilib = lib(pathmacros + "Hardware\RasberryPi"+ filesep()); sci2c_ScilabArduinolib = lib(pathmacros + "Scilab-Arduino" + filesep()); +sci2c_CVCorelib = lib(pathmacros + "ImageProcessing\core" + filesep()); +sci2c_CVHighguilib = lib(pathmacros + "ImageProcessing\highgui" + filesep()); clear pathmacros; // Load and add help chapter diff --git a/includes/sci2clib.h b/includes/sci2clib.h index db3a58e..e4eac2d 100644 --- a/includes/sci2clib.h +++ b/includes/sci2clib.h @@ -384,7 +384,7 @@ #include "types.h" -/* STRING*? +/* STRING*/ /* interface for String */ #include "int_string.h" /*include for string */ @@ -406,6 +406,12 @@ #include "convstr.h" #include "int_convstr.h" +/*Functions related to opencv*/ +#include "cvcore.h" +#include "int_cvcore.h" +#include "cvhighgui.h" +#include "int_cvhighgui.h" + /*Scilab-arduino toolbox*/ #ifdef Arduino1 #include "int_cmd_digital_out.h" @@ -421,10 +427,11 @@ #include "cmd_dcmotor_setup.h" #include "int_sleep.h" #include "sleep.h" -//#include "cmd_servo_attach.h" -//#include "cmd_servo_detach.h" -//#include "cmd_servo_move.h" -//#include "int_cmd_servo.h" +/*#include "cmd_servo_attach.h" +#include "cmd_servo_detach.h" +#include "cmd_servo_move.h" +#include "int_cmd_servo.h" +*/ #endif /*AVR*/ @@ -452,5 +459,7 @@ #include "RPIPeripheralThreading.h" #include "int_RPIPeripheralPinISR.h" #include "RPIPeripheralPinISR.h" +#include "int_RPIPeripheralPWM.h" +#include "RPIPeripheralPWM.h" #endif #endif /* !__SCI2CLIB_H__ */ diff --git a/macros/ASTManagement/AST_HandleEndGenFun.bin b/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex 4da5775..123ff51 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci index de5ae80..df4334f 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -72,6 +72,9 @@ global STACKDEDUG //NUT: verifica se ASTFunType e' veramente importante // #RNU_RES_E [ASTFunName,InArg,NInArg,OutArg,NOutArg] = AST_GetFuncallPrm(FileInfo,SharedInfo,ASTFunType); + if(mtlb_strcmp(part(ASTFunName,1:2),'CV') == %T) + SharedInfo.OpenCVUsed = %T; + end if (ASTFunName == 'OpIns') SharedInfo.SkipNextEqual = 1; diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex 5a095f4..efa5cd6 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/macros/CCodeGeneration/C_GenerateMakefile.sci b/macros/CCodeGeneration/C_GenerateMakefile.sci index 29e8a08..a915616 100644 --- a/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -65,15 +65,14 @@ if getos() == 'Windows' then else if (target == 'RPi') PrintStringInfo('CC = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y'); - else + PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lwiringPi',FileInfo.MakefileFilename,'file','y','y'); + else PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); - 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 -lwiringPi',FileInfo.MakefileFilename,'file','y','y'); - else - PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y'); - end + PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y'); + end + end //If ode function is used, add libgsl. if(size(SharedInfo.Includelist) <> 0) @@ -82,21 +81,26 @@ if(size(SharedInfo.Includelist) <> 0) end end +if(SharedInfo.OpenCVUsed == %T) + PrintStringInfo('LDFLAGS += `pkg-config --libs opencv`',FileInfo.MakefileFilename,'file','y','y'); + PrintStringInfo('CFLAGS += `pkg-config --cflags opencv`',FileInfo.MakefileFilename,'file','y','y'); +end + // Binary definition -PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y'); +PrintStringInfo('EXEFILENAME = '+SharedInfo.SCIMainFunName,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y'); // Sources //Check the output format selected and insert files according to it target = SharedInfo.Target; PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y'); -allSources = getAllSources(target); +allSources = getAllSources(SharedInfo); nbSources = size(allSources); for i = 1:(nbSources(1) - 1) [tmppath,tmpfile,tmpext] = fileparts(allSources(i)); - if(~isempty(strstr(allSources(i),'ode'))) + if(~isempty(strstr(allSources(i),'dode'))) 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'); diff --git a/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin Binary files differindex f9bad33..78311b6 100644 --- a/macros/CCodeGeneration/C_Type.bin +++ b/macros/CCodeGeneration/C_Type.bin diff --git a/macros/CCodeGeneration/C_Type.sci b/macros/CCodeGeneration/C_Type.sci index 3c56b71..60a3f8b 100644 --- a/macros/CCodeGeneration/C_Type.sci +++ b/macros/CCodeGeneration/C_Type.sci @@ -50,6 +50,8 @@ elseif (ArgType == 'i32') 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 = ''; +elseif (ArgType == 'im') + OutC_Type = 'IplImage*' else error(9999, 'Unknown Argument Type: ""'+ArgType+'"".'); end diff --git a/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin b/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin Binary files differindex 61f446f..fa48e83 100644 --- a/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin +++ b/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin diff --git a/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci b/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci index da5486d..3603c57 100644 --- a/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci +++ b/macros/FunctionAnnotation/FA_GetDefaultPrecision.sci @@ -87,6 +87,8 @@ else defaultprecision = 'u16';
elseif (tmpprecision == 'INT16')
defaultprecision = 'i16';
+ elseif (tmpprecision == 'CVIMAGE')
+ defaultprecision = 'IplImage'
end
end
diff --git a/macros/FunctionAnnotation/FA_GetFunAnn.bin b/macros/FunctionAnnotation/FA_GetFunAnn.bin Binary files differindex c94c675..3c2f9d4 100644 --- a/macros/FunctionAnnotation/FA_GetFunAnn.bin +++ b/macros/FunctionAnnotation/FA_GetFunAnn.bin diff --git a/macros/FunctionAnnotation/FA_GetFunAnn.sci b/macros/FunctionAnnotation/FA_GetFunAnn.sci index ffdfa7f..912d099 100644 --- a/macros/FunctionAnnotation/FA_GetFunAnn.sci +++ b/macros/FunctionAnnotation/FA_GetFunAnn.sci @@ -131,7 +131,6 @@ if (FoundNOut*FoundNIn == 0) PrintStringInfo(' ',ReportFileName,'both','y');
error(9999, 'SCI2CERROR: Incorrect function annotation.');
else
-
// In case we are reading to much informations
readNewLine = %t;
diff --git a/macros/FunctionAnnotation/FA_TP_CVIMAGE.bin b/macros/FunctionAnnotation/FA_TP_CVIMAGE.bin Binary files differnew file mode 100644 index 0000000..1d824fb --- /dev/null +++ b/macros/FunctionAnnotation/FA_TP_CVIMAGE.bin diff --git a/macros/FunctionAnnotation/FA_TP_CVIMAGE.sci b/macros/FunctionAnnotation/FA_TP_CVIMAGE.sci new file mode 100644 index 0000000..1c0d174 --- /dev/null +++ b/macros/FunctionAnnotation/FA_TP_CVIMAGE.sci @@ -0,0 +1,30 @@ +function typeout = FA_TP_CVIMAGE() +// function typeout = FA_TP_INT16() +// ----------------------------------------------------------------- +// Returns the OpenCV image type specifier (im) +// for Function Annotations. +// +// Input data: +// --- +// +// Output data: +// typeout: string containing the type specifier. +// +// Status: +// +// Copyright 2007 Raffaele Nutricato & Alberto Morea. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),0,0); + + +// ------------------------ +// --- Generate Output. --- +// ------------------------ +typeout = 'im'; + +endfunction diff --git a/macros/FunctionAnnotation/FA_TP_INT16.bin b/macros/FunctionAnnotation/FA_TP_INT16.bin Binary files differindex 2ebb734..e28e0c5 100644 --- a/macros/FunctionAnnotation/FA_TP_INT16.bin +++ b/macros/FunctionAnnotation/FA_TP_INT16.bin diff --git a/macros/FunctionAnnotation/FA_TP_INT16.sci b/macros/FunctionAnnotation/FA_TP_INT16.sci index 8971754..67b8178 100644 --- a/macros/FunctionAnnotation/FA_TP_INT16.sci +++ b/macros/FunctionAnnotation/FA_TP_INT16.sci @@ -1,7 +1,7 @@ function typeout = FA_TP_INT16() // function typeout = FA_TP_INT16() // ----------------------------------------------------------------- -// Returns the "uint8" type specifier +// Returns the "int16" type specifier // for Function Annotations. // // Input data: diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib Binary files differindex b8b2d41..b7b5520 100644 --- a/macros/FunctionAnnotation/lib +++ b/macros/FunctionAnnotation/lib diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names index 3db59cc..d9ae572 100644 --- a/macros/FunctionAnnotation/names +++ b/macros/FunctionAnnotation/names @@ -51,6 +51,7 @@ FA_SZ_SEL1 FA_SZ_SEL2 FA_TP_C FA_TP_COMPLEX +FA_TP_CVIMAGE FA_TP_D FA_TP_I FA_TP_INT16 diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin Binary files differindex 960068e..0c64927 100644 --- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin +++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci index fe4edb1..a791f1e 100644 --- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci +++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci @@ -26,6 +26,10 @@ RPiSupportFunctions = [ "RPI_SerialGetChar" "RPI_ThreadCreate" "RPI_PinISR" + "RPI_HardPWMWrite" + "RPI_HardPWMSetRange" + "RPI_HardPWMSetClock" + "RPI_HardPWMSetMode" ]; //Note: "RPI_SerialSendData" is removed since distinction between input data diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin Binary files differindex 1de4e22..1f20deb 100644 --- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin +++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci index aede0b7..460a417 100644 --- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci +++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci @@ -6,7 +6,8 @@ function RPI_DigitalSetup(pin, direction) // // Parameters // pin : pin of RPi to be used -// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT) +// direction : direction to be set for pin +// 0 -> INPUT, 1 -> OUTPUT, 2->PWM Output // // Description // There are few pins available on RPi as Gpio or digital io. These pins can be used as digital output or input. Pin name must be provided from list provided. Please refer '' for complete list of pins. Direction can be 0 or 1 depending upon desired function (Input/output) diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin Binary files differnew file mode 100644 index 0000000..1efe080 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci new file mode 100644 index 0000000..3c05030 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci @@ -0,0 +1,27 @@ +function RPI_HardPWMSetClock(clock_divisor) +// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced +// using suitable clock_divisor (1 to 2048, powers of 2) +// +// Calling Sequence +// RPI_HardPWMSetClock(clock_divisor) +// +// Parameters +// clock_divisor: Value can be from 1 to 2048, powers of 2. +// Description +// This function decides pwm clock. +// PWM frequency = (PWM Clock frequency/Clock divisor/range) +// PWM clock frequency = 19.2 MHz +// clock divisor is setup using RPI_HardPWMSetClock +// range is setup using RPI_HardPWMSetRange +// Examples +// +// See also +// RPI_HardPWMSetWrite RPI_HardPWMSetRange +// +// 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_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin Binary files differnew file mode 100644 index 0000000..075d6e6 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci new file mode 100644 index 0000000..2ab697b --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci @@ -0,0 +1,24 @@ +function RPI_HardPWMSetMode(pwm_mode) +// Function to set PWM mode. Two modes are available - balanced and mark/space +// +// Calling Sequence +// RPI_HardPWMSetMode(pwm_mode) +// +// Parameters +// pwm_mode: decides pwm mode +// 0 -> balanced +// 1 -> mark/space +// Description +// This function decides pwm mode +// Examples +// +// See also +// RPI_HardPWMSetWrite RPI_HardPWMSetRange +// +// 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_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin Binary files differnew file mode 100644 index 0000000..8ded270 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci new file mode 100644 index 0000000..cb7dd67 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci @@ -0,0 +1,27 @@ +function RPI_HardPWMSetRange(range_val) +// Function to set range value for PWM. Range value along with clock divisor +// decides pwm frequency. Range value must be less than 1024 +// +// Calling Sequence +// RPI_HardPWMSetRange(range_val) +// +// Parameters +// range_val: range for pwm +// Description +// This function decides range for pwm. +// PWM frequency = (PWM Clock frequency/Clock divisor/range) +// PWM clock frequency = 19.2 MHz +// clock divisor is setup using RPI_HardPWMSetClock +// range is setup using RPI_HardPWMSetRange +// Examples +// +// See also +// RPI_HardPWMSetClock RPI_HardPWMWrite +// +// 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_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin Binary files differnew file mode 100644 index 0000000..9957f3a --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci new file mode 100644 index 0000000..9f9f797 --- /dev/null +++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci @@ -0,0 +1,31 @@ +function RPI_HardPWMWrite(pin,value) +// Function to change pwm duty on specified pin. Hardware PWM is available +// only on pin 12. So, only '12' should be provided as pin +// +// Calling Sequence +// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set +// using RPI_HARDPWMSetRange +// +// Parameters +// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed +// value: pwm value for given pin. This must be less than range value set +// Description +// This function changes pwm duty on specified pin. As for RPi, only one pin +// (pin 12) is available for hardware PWM. +// PWM frequency = (PWM Clock frequency/Clock divisor/range) +// PWM clock frequency = 19.2 MHz +// clock divisor is setup using RPI_HardPWMSetClock +// range is setup using RPI_HardPWMSetRange +// Actual PWM duty = value/range +// Examples +// +// See also +// RPI_HardPWMSetClock RPI_HardPWMSetRange +// +// 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 Binary files differindex 9e6dd09..928f28a 100644 --- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin +++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci index ce17ea8..0271449 100644 --- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci +++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci @@ -2,7 +2,7 @@ function data = RPI_SerialGetChar(fd) // Function to read data from specified serial port // // Calling Sequence -// RPI_SerialGetCharfd) +// RPI_SerialGetChar(fd) // // Parameters // fd: file descriptor returned when serial port was opened diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib Binary files differindex 40a6b04..d25d944 100644 --- a/macros/Hardware/RasberryPi/lib +++ b/macros/Hardware/RasberryPi/lib diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names index a97a189..fa64776 100644 --- a/macros/Hardware/RasberryPi/names +++ b/macros/Hardware/RasberryPi/names @@ -7,6 +7,10 @@ RPI_DigitalOut RPI_DigitalSetup RPI_GetMicros RPI_GetMillis +RPI_HardPWMSetClock +RPI_HardPWMSetMode +RPI_HardPWMSetRange +RPI_HardPWMWrite RPI_PinISR RPI_SerialClose RPI_SerialFlush diff --git a/macros/ImageProcessing/CV_CreateImage.bin b/macros/ImageProcessing/CV_CreateImage.bin Binary files differnew file mode 100644 index 0000000..4c638cc --- /dev/null +++ b/macros/ImageProcessing/CV_CreateImage.bin diff --git a/macros/ImageProcessing/CV_CreateImage.sci b/macros/ImageProcessing/CV_CreateImage.sci new file mode 100644 index 0000000..85c01a4 --- /dev/null +++ b/macros/ImageProcessing/CV_CreateImage.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function img = CV_CreateImage(width,height,bit_depth,no_of_channels) +// function to create an image object of given size and type +// +// Calling Sequence +// CV_CreateImage(image_size,bit_depth,no_of_channels) +// +// Parameters +// image_size: width and height of image +// bit_depth: Bit depth of image elements +// no_of_channels: no of channels per pixels +// +// Description +// This function can be used to create opencv image object. For more info +// about bit depth and channels,please refer to OpenCV documentation +// Examples +// CV_CreateImage([320 240], "8U", 1) //to create image of the size 320*240 +// pixels with 8 bit unsigned each pixels and gray scale image +// +// See also +// CV_LoadImage +// +// +// Authors +// Siddhesh Wani +// +img = 0; +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/buildmacros.sce b/macros/ImageProcessing/buildmacros.sce new file mode 100644 index 0000000..14c7c1b --- /dev/null +++ b/macros/ImageProcessing/buildmacros.sce @@ -0,0 +1,30 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +OpencvDirs = [ "core", ... + "highgui"]; + + + current_path = get_absolute_file_path("buildmacros.sce"); + + for L=1:size(OpencvDirs,"*") + myfile = current_path + filesep() + OpencvDirs(L) + filesep() + "buildmacros.sce"; + if isfile(myfile) then + exec(myfile); + end +end + +clear current_path; + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; + diff --git a/macros/ImageProcessing/core/CV_CreateImage.bin b/macros/ImageProcessing/core/CV_CreateImage.bin Binary files differnew file mode 100644 index 0000000..4c638cc --- /dev/null +++ b/macros/ImageProcessing/core/CV_CreateImage.bin diff --git a/macros/ImageProcessing/core/CV_CreateImage.sci b/macros/ImageProcessing/core/CV_CreateImage.sci new file mode 100644 index 0000000..4964920 --- /dev/null +++ b/macros/ImageProcessing/core/CV_CreateImage.sci @@ -0,0 +1,30 @@ +function img = CV_CreateImage(width,height,bit_depth,no_of_channels) +// function to create an image object of given size and type +// +// Calling Sequence +// CV_CreateImage(image_size,bit_depth,no_of_channels) +// +// Parameters +// image_size: width and height of image +// bit_depth: Bit depth of image elements +// no_of_channels: no of channels per pixels +// +// Description +// This function can be used to create opencv image object. For more info +// about bit depth and channels,please refer to OpenCV documentation +// Examples +// CV_CreateImage([320 240], "8U", 1) //to create image of the size 320*240 +// pixels with 8 bit unsigned each pixels and gray scale image +// +// See also +// CV_LoadImage +// +// +// Authors +// Siddhesh Wani +// +img = 0; +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/core/buildmacros.sce b/macros/ImageProcessing/core/buildmacros.sce new file mode 100644 index 0000000..60fd284 --- /dev/null +++ b/macros/ImageProcessing/core/buildmacros.sce @@ -0,0 +1,15 @@ +// +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// +// + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/ImageProcessing/core/lib b/macros/ImageProcessing/core/lib Binary files differnew file mode 100644 index 0000000..4bccbc8 --- /dev/null +++ b/macros/ImageProcessing/core/lib diff --git a/macros/ImageProcessing/core/names b/macros/ImageProcessing/core/names new file mode 100644 index 0000000..a681f79 --- /dev/null +++ b/macros/ImageProcessing/core/names @@ -0,0 +1 @@ +CV_CreateImage diff --git a/macros/ImageProcessing/highgui/CV_LoadImage.bin b/macros/ImageProcessing/highgui/CV_LoadImage.bin Binary files differnew file mode 100644 index 0000000..f8e1337 --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_LoadImage.bin diff --git a/macros/ImageProcessing/highgui/CV_LoadImage.sci b/macros/ImageProcessing/highgui/CV_LoadImage.sci new file mode 100644 index 0000000..93fc49b --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_LoadImage.sci @@ -0,0 +1,41 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function img = CV_LoadImage(filename,loadtype) +// function to load an image object from given filename +// +// Calling Sequence +// CV_LoadImage(filename,loadtype) +// +// Parameters +// filename: name of file to be opened +// loadtype: desired load method +// <0 --> image is loaded as is (with alpha channel) +// =0 --> image is loaded as greyscale +// >0 --> 3 channel color image is loaded +// +// Description +// This function can be used for loading a previously stored image +// Examples +// CV_LoadImage('~/test.jpg',0) +// +// See also +// CV_CreateImage +// +// +// Authors +// Siddhesh Wani +// +img = 0; +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/highgui/CV_SaveImage.bin b/macros/ImageProcessing/highgui/CV_SaveImage.bin Binary files differnew file mode 100644 index 0000000..8d056bf --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_SaveImage.bin diff --git a/macros/ImageProcessing/highgui/CV_SaveImage.sci b/macros/ImageProcessing/highgui/CV_SaveImage.sci new file mode 100644 index 0000000..8d5ca16 --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_SaveImage.sci @@ -0,0 +1,39 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function status = CV_SaveImage(filename,img) +// function to save an image object as a given filename +// +// Calling Sequence +// CV_SaveImage(filename,img) +// +// Parameters +// filename: name of file image to be saved as +// img: image to be saved +// +// Description +// This function can be used for saving image. File format is detected +// from file extension +// Examples +// img = CV_LoadImage('~/test.jpg',0) +// CV_SaveImage('test1.png',img) +// +// See also +// CV_LoadImage CV_CreateImage +// +// Authors +// Siddhesh Wani +// +status = 0; +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/highgui/CV_ShowImage.bin b/macros/ImageProcessing/highgui/CV_ShowImage.bin Binary files differnew file mode 100644 index 0000000..c4e00fc --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_ShowImage.bin diff --git a/macros/ImageProcessing/highgui/CV_ShowImage.sci b/macros/ImageProcessing/highgui/CV_ShowImage.sci new file mode 100644 index 0000000..0864c3f --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_ShowImage.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function CV_ShowImage(winname,img) +// function to show an image +// +// Calling Sequence +// CV_ShowImage(img) +// CV_ShowImage(winname,img) +// +// Parameters +// winname: name of window in which img is to be shown +// img: image to be shown already acquired (from file/camera) +// +// Description +// This function can be used for showing images +// Examples +// img = CV_LoadImage('~/test.jpg',0) +// CV_ShowImage(img) +// +// See also +// CV_CreateImage CV_LoadImage +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/highgui/CV_WaitKey.bin b/macros/ImageProcessing/highgui/CV_WaitKey.bin Binary files differnew file mode 100644 index 0000000..30a42f4 --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_WaitKey.bin diff --git a/macros/ImageProcessing/highgui/CV_WaitKey.sci b/macros/ImageProcessing/highgui/CV_WaitKey.sci new file mode 100644 index 0000000..514bc53 --- /dev/null +++ b/macros/ImageProcessing/highgui/CV_WaitKey.sci @@ -0,0 +1,40 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +function CV_WaitKey(delay) +// function similar to cvWaitKey +// +// Calling Sequence +// CV_WaitKey(delay) +// +// Parameters +// delay: waiting delay, if 0 then wait till keypress +// +// Description +// This function can be used for inseting some delay. This function must +// follow CV_ShowImage to display image. +// Examples +// img = CV_LoadImage('~/test.jpg',0) +// CV_ShowImage('',img) +// CV_WaitKey(0); +// +// See also +// CV_LoadImage CV_ShowImage +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for OpenCV + +endfunction diff --git a/macros/ImageProcessing/highgui/buildmacros.sce b/macros/ImageProcessing/highgui/buildmacros.sce new file mode 100644 index 0000000..60fd284 --- /dev/null +++ b/macros/ImageProcessing/highgui/buildmacros.sce @@ -0,0 +1,15 @@ +// +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// +// + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/macros/ImageProcessing/highgui/lib b/macros/ImageProcessing/highgui/lib Binary files differnew file mode 100644 index 0000000..2db0482 --- /dev/null +++ b/macros/ImageProcessing/highgui/lib diff --git a/macros/ImageProcessing/highgui/names b/macros/ImageProcessing/highgui/names new file mode 100644 index 0000000..a717164 --- /dev/null +++ b/macros/ImageProcessing/highgui/names @@ -0,0 +1,4 @@ +CV_LoadImage +CV_SaveImage +CV_ShowImage +CV_WaitKey diff --git a/macros/ImageProcessing/lib b/macros/ImageProcessing/lib Binary files differnew file mode 100644 index 0000000..d374b90 --- /dev/null +++ b/macros/ImageProcessing/lib diff --git a/macros/ImageProcessing/names b/macros/ImageProcessing/names new file mode 100644 index 0000000..a681f79 --- /dev/null +++ b/macros/ImageProcessing/names @@ -0,0 +1 @@ +CV_CreateImage diff --git a/macros/SymbolTable/ST_AnalyzeScope.bin b/macros/SymbolTable/ST_AnalyzeScope.bin Binary files differindex 950f704..7e727a0 100644 --- a/macros/SymbolTable/ST_AnalyzeScope.bin +++ b/macros/SymbolTable/ST_AnalyzeScope.bin diff --git a/macros/SymbolTable/ST_AnalyzeScope.sci b/macros/SymbolTable/ST_AnalyzeScope.sci index c89c359..6ce9482 100644 --- a/macros/SymbolTable/ST_AnalyzeScope.sci +++ b/macros/SymbolTable/ST_AnalyzeScope.sci @@ -47,6 +47,7 @@ TempVarsFileName = FileInfo.Funct(nxtscifunnumber).TempVarFileName; // ------------------------------------------------------------------
// #RNU_RES_E
for cntout = 1:NOutArg
+
// #RNU_RES_B
PrintStringInfo(' Symbol ""'+OutArg(cntout).Name+'""',ReportFileName,'file','y');
// #RNU_RES_E
diff --git a/macros/SymbolTable/ST_InsOutArg.bin b/macros/SymbolTable/ST_InsOutArg.bin Binary files differindex 94bcd3a..108d297 100644 --- a/macros/SymbolTable/ST_InsOutArg.bin +++ b/macros/SymbolTable/ST_InsOutArg.bin diff --git a/macros/SymbolTable/ST_InsOutArg.sci b/macros/SymbolTable/ST_InsOutArg.sci index 7d99ddf..85c983d 100644 --- a/macros/SymbolTable/ST_InsOutArg.sci +++ b/macros/SymbolTable/ST_InsOutArg.sci @@ -94,7 +94,8 @@ for counteroutput = 1:NOutArg if (TBFlagfound == 1)
if (TBFlagEqualSymbols == 0)
PrintStringInfo(' ',ReportFileName,'both','y');
- PrintStringInfo('SCI2CERROR: Symbol Table Conflict. Trying to insert again symbol ""'+...
+ PrintStringIn
+ fo('SCI2CERROR: Symbol Table Conflict. Trying to insert again symbol ""'+...
OutArg(counteroutput).Name+'"" with different settings',ReportFileName,'both','y');
PrintStringInfo('SCI2CERROR: Please check that you are not using variable ""'+OutArg(counteroutput).Name+'""',ReportFileName,'both','y');
PrintStringInfo('SCI2CERROR: with different sizes and/or types.',ReportFileName,'both','y');
@@ -125,6 +126,13 @@ for counteroutput = 1:NOutArg OutArg(counteroutput).Dimension,...
SymbTableFileName);
end
+
+ // IndentLevelDeclaration = 1; //NUT: per ora lo forzo sempre a 1
+ // IndentLevelMalloc = SharedInfo.NIndent;
+ // FlagExt = 0;
+ // C_GenDeclarations(OutArg(counteroutput),CDeclarationFileName,IndentLevelDeclaration,ReportFileName,FlagExt,SharedInfo.ResizeApproach);
+
+
end
elseif (TBFlagfound == 2)
// #RNU_RES_B
diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex f9c8482..ab16036 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 72652e0..5e4eb03 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4769,30 +4769,40 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+FunctionName = 'RPI_DigitalOut';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_HardPWMWrite';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
//------------------------------------
//---- Class RPI_DigitalOut ----------
//------------------------------------
-ClassName = 'RPI_DigitalOut';
+//ClassName = 'RPI_DigitalOut';
// --- 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');
+//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);
+//ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+//PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
-FunctionName = 'RPI_DigitalOut';
-PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
-INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
-INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//FunctionName = 'RPI_DigitalOut';
+//PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+//INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+//INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
//------------------------------------
//---- Class RPI_DigitalIn -----------
@@ -4822,21 +4832,21 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
//---- Class RPI_DelayMilli ----------
//------------------------------------
-ClassName = 'RPI_DelayMilli';
+//ClassName = 'RPI_DelayMilli';
// --- 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');
+//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);
+//ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+//PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
// --- Annotation Function And Function List Function. ---
FunctionName = 'RPI_DelayMilli';
@@ -4849,6 +4859,31 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+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);
+
+FunctionName = 'RPI_HardPWMSetRange';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_HardPWMSetClock';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_HardPWMSetMode';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
//------------------------------------
//---- Class RPI_GetMilli ----------
//------------------------------------
@@ -4907,31 +4942,31 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,Ex //------------------------------------
//---- Class RPI_SetupClose ----------
//------------------------------------
-ClassName = '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');
+//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);
+//ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
-PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+//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);
+//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 ----------
@@ -5500,6 +5535,118 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class cvCreateImage --------------------
+//------------------------------------
+ClassName = 'CV_CreateImage';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 4',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''im''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0g2d0'+ArgSeparator+'im0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_CreateImage';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class cvLoadImage --------------------
+//------------------------------------
+ClassName = 'CV_LoadImage';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''im''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2d0'+ArgSeparator+'im0',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_LoadImage';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class cvShowImage -------------
+//------------------------------------
+ClassName = 'CV_ShowImage';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+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');
+
+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');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('g2im0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('im0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_ShowImage';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'CV_SaveImage';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class CV_WaitKey --------------
+//------------------------------------
+ClassName = 'CV_WaitKey';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+
+//Arguements specified: initial value, start time, time vector, ode function
+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');
+
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'CV_WaitKey';
+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_GenSharedInfo.bin b/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex f0955c3..7263830 100644 --- a/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/macros/ToolInitialization/INIT_GenSharedInfo.sci b/macros/ToolInitialization/INIT_GenSharedInfo.sci index 2aeec08..abe813c 100644 --- a/macros/ToolInitialization/INIT_GenSharedInfo.sci +++ b/macros/ToolInitialization/INIT_GenSharedInfo.sci @@ -62,7 +62,7 @@ SharedInfo.NFilesToTranslate = 1; // --- Annotations. ---
SharedInfo.Annotations.GBLVAR = 'global';
-SharedInfo.Annotations.DataPrec = {'uint8','int8','uint16','int16','int','float','double'};
+SharedInfo.Annotations.DataPrec = {'uint8','int8','uint16','int16','int','float','double','IplImage'};
SharedInfo.Annotations.FUNNIN = 'NIN=';
SharedInfo.Annotations.FUNNOUT = 'NOUT=';
SharedInfo.Annotations.FUNTYPE = '''OUT(''+string(SCI2C_nout)+'').TP='''; // Type includes also precision.
@@ -130,5 +130,6 @@ SharedInfo.Target = Target; // Specifies code generation target. SharedInfo.Includelist = list(); //Maintains list of functions being used in code
// to add their header files to main function.
+SharedInfo.OpenCVUsed = %F; // Specifies if opencv library is used or not
endfunction
diff --git a/macros/buildmacros.sce b/macros/buildmacros.sce index 91f5a06..f02096d 100644 --- a/macros/buildmacros.sce +++ b/macros/buildmacros.sce @@ -8,10 +8,11 @@ Directories = [ "ASTManagement", ... "FunctionList", ... "GeneralFunctions", ... "SymbolTable", ... - "ToolInitialization"... - "Hardware/AVR"... - "Hardware/RasberryPi"... - "Scilab-Arduino" ]; + "ToolInitialization", ... + "Hardware/AVR", ... + "Hardware/RasberryPi", ... + "ImageProcessing", ... + "Scilab-Arduino"]; current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); diff --git a/macros/findDeps/getAllHeaders.bin b/macros/findDeps/getAllHeaders.bin Binary files differindex b7773ac..2dad8e8 100644 --- a/macros/findDeps/getAllHeaders.bin +++ b/macros/findDeps/getAllHeaders.bin diff --git a/macros/findDeps/getAllHeaders.sci b/macros/findDeps/getAllHeaders.sci index 71b8b20..846f8f6 100644 --- a/macros/findDeps/getAllHeaders.sci +++ b/macros/findDeps/getAllHeaders.sci @@ -10,7 +10,8 @@ // // -function allHeaders = getAllHeaders(Target) +function allHeaders = getAllHeaders(SharedInfo) + Target = SharedInfo.Target; //Header files common to all types of output format. Standalone_headers = [ @@ -176,8 +177,13 @@ function allHeaders = getAllHeaders(Target) "src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h" "src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h" "src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h" + "src/c/hardware/rasberrypi/includes/RPIPeripheralPWM.h" ]; + OpenCV_headers = [ + "src/c/imageProcessing/includes/cvcore.h" + "src/c/imageProcessing/includes/cvhighgui.h"]; + if Target == "StandAlone" allHeaders = Standalone_headers; elseif Target == "Arduino" @@ -188,4 +194,8 @@ function allHeaders = getAllHeaders(Target) allHeaders = cat(1,Standalone_headers, RPi_headers); end + if (SharedInfo.OpenCVUsed == %T) + allHeaders = cat(1,allHeaders,OpenCV_headers); + end + endfunction diff --git a/macros/findDeps/getAllInterfaces.bin b/macros/findDeps/getAllInterfaces.bin Binary files differindex 3558d2c..ee40b12 100644 --- a/macros/findDeps/getAllInterfaces.bin +++ b/macros/findDeps/getAllInterfaces.bin diff --git a/macros/findDeps/getAllInterfaces.sci b/macros/findDeps/getAllInterfaces.sci index 9d86180..9097547 100644 --- a/macros/findDeps/getAllInterfaces.sci +++ b/macros/findDeps/getAllInterfaces.sci @@ -10,7 +10,8 @@ // // -function allInterfaces = getAllInterfaces(Target) +function allInterfaces = getAllInterfaces(SharedInfo) + Target = SharedInfo.Target; //Interface files common to all types of output format Standalone_interfaces = [ "src/c/auxiliaryFunctions/interfaces/int_rand.h" @@ -167,8 +168,13 @@ function allInterfaces = getAllInterfaces(Target) "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h" "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralThreading.h" "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinISR.h" + "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h" ]; + OpenCV_interfaces = [ + "src/c/imageProcessing/interfaces/int_cvcore.h" + "src/c/imageProcessing/interfaces/int_cvhighgui.h"]; + if Target == "StandAlone" allInterfaces = Standalone_interfaces; elseif Target == "Arduino" @@ -179,4 +185,8 @@ function allInterfaces = getAllInterfaces(Target) allInterfaces = cat(1,Standalone_interfaces, RPI_interfaces); end + if (SharedInfo.OpenCVUsed == %T) + allInterfaces = cat(1,allInterfaces,OpenCV_interfaces) + end + endfunction diff --git a/macros/findDeps/getAllLibraries.bin b/macros/findDeps/getAllLibraries.bin Binary files differindex 7828cd2..c6d006f 100644 --- a/macros/findDeps/getAllLibraries.bin +++ b/macros/findDeps/getAllLibraries.bin diff --git a/macros/findDeps/getAllLibraries.sci b/macros/findDeps/getAllLibraries.sci index 7741caf..7cd8f91 100644 --- a/macros/findDeps/getAllLibraries.sci +++ b/macros/findDeps/getAllLibraries.sci @@ -1,6 +1,5 @@ - -function allLibraries = getAllLibraries(Target) - +function allLibraries = getAllLibraries(SharedInfo) + Target = SharedInfo.Target; //Library files required for "RasberryPi" target RPi_libs = [ "src/c/hardware/rasberrypi/libraries/wiringPi/libwiringPi.so" diff --git a/macros/findDeps/getAllSources.bin b/macros/findDeps/getAllSources.bin Binary files differindex 5f60ac9..974e946 100644 --- a/macros/findDeps/getAllSources.bin +++ b/macros/findDeps/getAllSources.bin diff --git a/macros/findDeps/getAllSources.sci b/macros/findDeps/getAllSources.sci index 84975fc..dafa503 100644 --- a/macros/findDeps/getAllSources.sci +++ b/macros/findDeps/getAllSources.sci @@ -10,7 +10,9 @@ // // -function allSources = getAllSources(Target) +function allSources = getAllSources(SharedInfo) + Target = SharedInfo.Target; + //Files common to types of output format Standalone_files = [ "src/c/auxiliaryFunctions/abs/sabsa.c" "src/c/auxiliaryFunctions/abs/sabss.c" @@ -1029,9 +1031,18 @@ function allSources = getAllSources(Target) "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/pwm/u8RPIHardPWMWrites.c" + "src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c" + "src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c" + "src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c" "src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c" ]; + OpenCV_files = [ + "src/c/imageProcessing/cvcore/imcvCreateImages.c" + "src/c/imageProcessing/cvhighgui/imcvLoadImages.c" + "src/c/imageProcessing/cvhighgui/imcvShowImages.c"]; + if Target == "StandAlone" allSources = Standalone_files; elseif Target == "Arduino" @@ -1042,4 +1053,9 @@ function allSources = getAllSources(Target) allSources = cat(1,Standalone_files, RPI_files); end + if (SharedInfo.OpenCVUsed == %T) + allSources = cat(1,allSources,OpenCV_files); + end + + endfunction diff --git a/macros/runsci2c.bin b/macros/runsci2c.bin Binary files differindex e3770d0..6292824 100644 --- a/macros/runsci2c.bin +++ b/macros/runsci2c.bin diff --git a/macros/runsci2c.sci b/macros/runsci2c.sci index 5efca90..b0bb16b 100644 --- a/macros/runsci2c.sci +++ b/macros/runsci2c.sci @@ -92,11 +92,11 @@ load(SharedInfoDatFile,'SharedInfo'); global SCI2CHOME
-allSources = SCI2CHOME + "/" + getAllSources(Target);
-allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
-allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
-if(~isempty(getAllLibraries(Target)))
- allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
+allSources = SCI2CHOME + "/" + getAllSources(SharedInfo);
+allHeaders = SCI2CHOME + "/" +getAllHeaders(SharedInfo);
+allInterfaces = SCI2CHOME + "/" + getAllInterfaces(SharedInfo);
+if(~isempty(getAllLibraries(SharedInfo)))
+ allLibraries = SCI2CHOME + "/" + getAllLibraries(SharedInfo);
else
allLibraries = ''
end
@@ -115,7 +115,7 @@ for i = 1:size(allSources, "*") // DEBUG only
//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(~isempty(strstr(allSources(i),'dode')))
if(size(SharedInfo.Includelist) <> 0)
if((mtlb_strcmp(part(SharedInfo.Includelist(1),1:5),'odefn') == %T))
copyfile(allSources(i), SCI2COutputPath+"/src/c/");
diff --git a/src/c/differential_calculus/diff/u16diffca.c b/src/c/differential_calculus/diff/u16diffca.c new file mode 100644 index 0000000..d83a9e6 --- /dev/null +++ b/src/c/differential_calculus/diff/u16diffca.c @@ -0,0 +1,203 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + + /* This function calculates difference between adjacent members of given + input array/matrix */ + +#include "diffc.h" + + +void u16diffca(uint16 *in, int row, int col, int depth, int dim, uint16 *out) +{ + int counter, depth_count; + int row_count, col_count; + uint16 *buffer; /*To store intermediate results*/ + + depth_count = 1; + + if(dim == 0) + { /*For dim = 0, we calculate difference between adjacent elements + in case of arrays. In case of matrices, we calculate difference along + first column, and then continue to second (diff between first element + of second column and last element of first column, then third etc.*/ + if(depth == 1) + {/*for depth=1, a buffer is not needed. Directly write result in + out buffer*/ + for(counter = 0; counter < row*col - depth_count; counter++) + { + out[counter] = in[counter+1] - in[counter]; + } + } + else + { /*define buffer for storing intermediate results*/ + + buffer = (uint16 *) malloc (sizeof(uint16)*(row*col-1)); + + while(depth_count <= depth) + { + if(depth_count == 1) + { + /*calculate diff and store in buffer*/ + for(counter = 0; counter < row*col - depth_count; counter++) + { + buffer[counter] = in[counter+1] - in[counter]; + } + } + else if(depth_count < depth) + { + for(counter = 0; counter <= row*col - depth_count ; counter++) + { + buffer[counter] = buffer[counter+1] - buffer[counter]; + } + } + /*For last step use output buffer to store result*/ + else + { + for(counter = 0; counter < row*col - depth_count; counter++) + { + out[counter] = buffer[counter+1] - buffer[counter]; + } + } + depth_count += 1; + } + } + + } + else if(dim == 1) + { + /*For dim = 1, difference is calculated along rows. Each element of + first row is subtracted from corresponding element of second row and + result is stored in first row. Same thing is repeated till last row. */ + + if (depth == 1) + { + /*If depth is 1, store result directly in out buffer*/ + for(col_count = 0; col_count < col; col_count++) + { + for(row_count = 0; row_count < row - 1; row_count++) + { + out[col_count*(row-1)+row_count] = in[col_count*row + row_count+1] \ + - in[col_count*row + row_count]; + } + } + } + else + { + /*If depth is not 1, declare a buffer to store intermediate + results. At last step store result into out buffer*/ + buffer = (uint16 *) malloc (sizeof(uint16)*((row-1)*col)); + + while(depth_count <= depth) + { + if(depth_count == 1) + { + /*For first step, use in buffer and store results in buffer*/ + for(col_count = 0; col_count < col; col_count++) + { + for(row_count = 0; row_count < row - 1; row_count++) + { + buffer[col_count*row+row_count] = in[col_count*row + row_count + 1] \ + - in[col_count*row + row_count]; + } + + } + } + else if(depth_count < depth) + { + for(col_count = 0; col_count < col; col_count++) + { + for(row_count = 0; row_count < row - depth_count; row_count++) + { + buffer[col_count*row+row_count] = buffer[col_count*row + row_count + 1] \ + - buffer[col_count*row + row_count]; + } + + } + } + else + { + for(col_count = 0; col_count < col; col_count++) + { + for(row_count = 0; row_count < row - depth_count; row_count++) + { + out[col_count*(row-depth_count)+row_count] = buffer[col_count*row + row_count+1] \ + - buffer[col_count*row + row_count]; + } + } + } + depth_count +=1; + } + } + } + else if(dim == 2) + { + /*For dim = 2, difference is calculated along columns. Each element of + first column is subtracted from corresponding element of second column + and result is stored in first column. Same thing is repeated till last + column. */ + if(depth == 1) + { + for(row_count = 0; row_count < row; row_count++) + { + for(col_count = 0; col_count < col - 1; col_count++) + { + out[col_count*row+row_count] = in[(col_count+1)*row + row_count] \ + - in[col_count*row + row_count]; + } + } + } + else + { + /*If depth is not 1, declare a buffer to store intermediate + results. At last step store result into out buffer*/ + buffer = (uint16 *) malloc (sizeof(uint16)*(row*(col-1))); + + while(depth_count <= depth) + { + if(depth_count == 1) + { + for(row_count = 0; row_count < row; row_count++) + { + for(col_count = 0; col_count < col - 1; col_count++) + { + buffer[col_count*row+row_count] = in[(col_count+1)*row + row_count] \ + - in[col_count*row + row_count]; + } + } + } + else if(depth_count < depth) + { + for(row_count = 0; row_count < row; row_count++) + { + for(col_count = 0; col_count < col - depth_count; col_count++) + { + buffer[col_count*row+row_count] = buffer[(col_count+1)*row + row_count] \ + - buffer[col_count*row + row_count]; + } + } + } + else + { + for(row_count = 0; row_count < row; row_count++) + { + for(col_count = 0; col_count < col - depth_count; col_count++) + { + out[col_count*row+row_count] = buffer[(col_count+1)*row + row_count] \ + - buffer[col_count*row + row_count]; + } + } + } + depth_count += 1; + } + } + } +} diff --git a/src/c/differential_calculus/includes/diffc.h b/src/c/differential_calculus/includes/diffc.h index 7d266f1..2e2cf01 100644 --- a/src/c/differential_calculus/includes/diffc.h +++ b/src/c/differential_calculus/includes/diffc.h @@ -13,6 +13,8 @@ #define __DIFFC_H__ #include "types.h" +#include <stdio.h> +#include <stdlib.h> #ifdef __cplusplus extern "C" { diff --git a/src/c/elementaryFunctions/bitset/u16bitsets.c b/src/c/elementaryFunctions/bitset/u16bitsets.c index 953e46c..ff72be3 100644 --- a/src/c/elementaryFunctions/bitset/u16bitsets.c +++ b/src/c/elementaryFunctions/bitset/u16bitsets.c @@ -7,12 +7,12 @@ uint16 u16bitsets(uint16 value,int position,int bit_value) { if(bit_value==1) { - unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + unsigned char mask1 = 1 << (position-1) ; /* we could cast to unsigned char, just to be safe */ return (mask1 | value); } else { - unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + unsigned char mask2 = ~(1 << (position-1)); /*we could cast to unsigned char, just to be safe*/ return (mask2 & value); } diff --git a/src/c/elementaryFunctions/bitset/u8bitsets.c b/src/c/elementaryFunctions/bitset/u8bitsets.c index 5f44dcd..b97a157 100644 --- a/src/c/elementaryFunctions/bitset/u8bitsets.c +++ b/src/c/elementaryFunctions/bitset/u8bitsets.c @@ -7,12 +7,12 @@ uint8 u8bitsets(uint8 value,int position,int bit_value) { if(bit_value==1) { - unsigned char mask1 = 1 << (position-1) ; // we could cast to unsigned char, just to be safe + unsigned char mask1 = 1 << (position-1) ; /* we could cast to unsigned char, just to be safe */ return (mask1 | value); } else { - unsigned char mask2 = ~(1 << (position-1)); // we could cast to unsigned char, just to be safe + unsigned char mask2 = ~(1 << (position-1)); /* we could cast to unsigned char, just to be safe */ return (mask2 & value); } diff --git a/src/c/elementaryFunctions/includes/fix.h b/src/c/elementaryFunctions/includes/fix.h index d3e7f88..592905b 100644 --- a/src/c/elementaryFunctions/includes/fix.h +++ b/src/c/elementaryFunctions/includes/fix.h @@ -17,6 +17,9 @@ #include "floatComplex.h" #include "doubleComplex.h" #include "types.h" +#include "floor.h" +#include "ceil.h" + #ifdef __cplusplus extern "C" { diff --git a/src/c/elementaryFunctions/linspace/dlinspacea.c b/src/c/elementaryFunctions/linspace/dlinspacea.c index f67968d..d2ca698 100644 --- a/src/c/elementaryFunctions/linspace/dlinspacea.c +++ b/src/c/elementaryFunctions/linspace/dlinspacea.c @@ -7,7 +7,7 @@ void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,dou { int i,j,k; double temp; - float step_iterate[_row]; // for each row the spacing between two values is different. + float step_iterate[_row]; /* for each row the spacing between two values is different.*/ for(i=0;i<_row;i++) { @@ -16,7 +16,7 @@ void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,dou } for(j=0;j < _row;j++) { - out[j] = low_limit[j]; // For every row first element is the first value of low_limit array + out[j] = low_limit[j]; /* For every row first element is the first value of low_limit array*/ temp = low_limit[j]; for(k=1;k < (double)range_num;k++ ) { @@ -24,7 +24,7 @@ void dlinspacea(double *low_limit,int _row,double *up_limit,double range_num,dou temp = out[(_row*k)+j]; if(k == (double)range_num-1 ) { - out[(_row*k)+j] = (double)up_limit[j]; // Last value of output is equal to first value of up_limit array + out[(_row*k)+j] = (double)up_limit[j]; /* Last value of output is equal to first value of up_limit array*/ } } diff --git a/src/c/elementaryFunctions/linspace/dlinspaces.c b/src/c/elementaryFunctions/linspace/dlinspaces.c index 82b88e3..daeb825 100644 --- a/src/c/elementaryFunctions/linspace/dlinspaces.c +++ b/src/c/elementaryFunctions/linspace/dlinspaces.c @@ -8,14 +8,14 @@ void dlinspaces(double low_limit,double up_limit,double range_num,double *out) int j; double temp = low_limit; float step_iterate = (up_limit-low_limit)/(range_num-1); - out[0] = low_limit; //First value of output is equal to low_limit value + out[0] = low_limit; /*First value of output is equal to low_limit value*/ for(j=1; j<(double)range_num; j++) { out[j] = temp + step_iterate; temp = out[j]; if(j == (double)range_num-1 ) { - out[j] = (double)up_limit; // Last value of output is equal to up_limit value + out[j] = (double)up_limit; /* Last value of output is equal to up_limit value*/ } } diff --git a/src/c/elementaryFunctions/logspace/dlogspacea.c b/src/c/elementaryFunctions/logspace/dlogspacea.c index f8b283c..9ea551b 100644 --- a/src/c/elementaryFunctions/logspace/dlogspacea.c +++ b/src/c/elementaryFunctions/logspace/dlogspacea.c @@ -8,7 +8,7 @@ void dlogspacea(double *low_limit,int _row,double *up_limit,double range_num,dou { int i,j,k; double temp; - double step_iterate[_row]; // for each row the spacing between two values is different. + double step_iterate[_row]; /* for each row the spacing between two values is different.*/ for(i=0;i<_row;i++) { step_iterate[i] = pow(10,((up_limit[i]-low_limit[i])/(range_num-1))); @@ -17,7 +17,7 @@ void dlogspacea(double *low_limit,int _row,double *up_limit,double range_num,dou } for(j=0;j < _row;j++) { - out[j] = pow(10,low_limit[j]); // For every row first element is equal to 10 raise to the first value of low_limit array + out[j] = pow(10,low_limit[j]); /* For every row first element is equal to 10 raise to the first value of low_limit array*/ temp = out[j]; for(k=1;k < (double)range_num;k++ ) { @@ -25,7 +25,7 @@ void dlogspacea(double *low_limit,int _row,double *up_limit,double range_num,dou temp = out[(_row*k)+j]; if(k == (double)range_num-1 ) { - out[(_row*k)+j] = pow(10,((double)up_limit[j])); // For every row Last value of output is equal to 10 raise to first value of up_limit array + out[(_row*k)+j] = pow(10,((double)up_limit[j])); /* For every row Last value of output is equal to 10 raise to first value of up_limit array*/ } } diff --git a/src/c/elementaryFunctions/logspace/dlogspaces.c b/src/c/elementaryFunctions/logspace/dlogspaces.c index 7970321..851713b 100644 --- a/src/c/elementaryFunctions/logspace/dlogspaces.c +++ b/src/c/elementaryFunctions/logspace/dlogspaces.c @@ -9,14 +9,14 @@ void dlogspaces(double low_limit,double up_limit,double range_num,double *out) int j; double temp = pow(10,low_limit); double step_iterate = pow(10,((up_limit-low_limit)/(range_num-1))); - out[0] = pow(10,low_limit); //First value of output is equal to low_limit value + out[0] = pow(10,low_limit); /*First value of output is equal to low_limit value*/ for(j=1; j<(double)range_num; j++) { out[j] = temp*step_iterate; temp = out[j]; if(j == (double)range_num-1 ) { - out[j] = pow(10,((double)up_limit)); // Last value of output is equal to up_limit value + out[j] = pow(10,((double)up_limit)); /* Last value of output is equal to up_limit value*/ } } diff --git a/src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c b/src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c index 425fc97..6e398a1 100644 --- a/src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c +++ b/src/c/hardware/rasberrypi/ISR/i16RPIPinISRs.c @@ -16,7 +16,7 @@ #include "RPIPeripheralPinISR.h" #include "RPIPeripheralDigital.h" -int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction)) +int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction)(void)) { int status; status = wiringPiISR((int)phy_pin[pin-1], (int) edgetype, ISRFunction); diff --git a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c index d40263f..a5f80e5 100644 --- a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c +++ b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c @@ -19,8 +19,10 @@ /*pin is reduced by one as array index starts from 0 and pin no starts from 1*/ uint8 u8RPIDigitalOuts(uint8 pin, uint8 state) { - if (state == 0) //low output + if (state == 0) /*low output*/ digitalWrite(phy_pin[pin-1], LOW); - if (state == 1) //high output + if (state == 1) /*high output*/ digitalWrite(phy_pin[pin-1], HIGH); + + return 0; } diff --git a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c index 163f0c8..37cfc03 100644 --- a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c +++ b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c @@ -28,14 +28,13 @@ int phy_pin[] = {17, 17, 8, 17, 9, 17, 7, 15, 17, 16, /*Pin 1 to 10*/ /*pin is reduced by one as arrayiindex starts from 0 and pin no starts from 1*/ uint8 u8RPIDigitalSetups(uint8 pin, uint8 direction) { - if(direction == 1) //Pin to be used as output - { - pinMode(phy_pin[pin-1], OUTPUT); - } + if(direction == 1) /*Pin to be used as output*/ + pinMode(phy_pin[pin-1], OUTPUT); + else if(direction == 2) + pinMode(phy_pin[pin-1], PWM_OUTPUT); else - { pinMode(phy_pin[pin-1], INPUT); - } + return 0; } diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralPWM.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralPWM.h new file mode 100644 index 0000000..47634d0 --- /dev/null +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralPWM.h @@ -0,0 +1,31 @@ + /* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __RPIPERIPHERALPWM_H__ +#define __RPIPERIPHERALPWM_H__ + +#include "types.h" +#include "wiringPi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +uint8 u8RPIHardPWMWrites(uint8 pin, uint16 value); +uint8 u8RPIHardPWMSetRanges(uint16 value); +uint8 u8RPIHardPWMSetModes(uint8 mode); +uint8 u8RPIHardPWMSetClocks(uint16 clk_divisor); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__RPIPERIPHERALPWM_H__*/ diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h index de05f90..fc5a8d0 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h @@ -17,7 +17,7 @@ extern "C" { #endif -int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction)); +int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction)(void)); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h index 4c5d3a5..2304567 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h @@ -19,7 +19,7 @@ extern "C" { #endif -uint16 RPIThreadCreate(void (*threadFunction)); +uint16 RPIThreadCreate(void *(*threadFunction)(void)); #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h new file mode 100644 index 0000000..8c8f4c6 --- /dev/null +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h @@ -0,0 +1,30 @@ + /* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ +#ifndef __INT_RPIPERIPHERALPWM_H__ +#define __INT_RPIPERIPHERALPWM_H__ + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RPI_HardPWMWrite(pin,value) u8RPIHardPWMWrites((uint8)pin,(uint16)value) +#define RPI_HardPWMSetRange(value) u8RPIHardPWMSetRanges((uint16)value) +#define RPI_HardPWMSetMode(mode) u8RPIHardPWMSetModes((uint8)mode) +#define RPI_HardPWMSetClock(clk_divisor) u8RPIHardPWMSetClocks((uint16)clk_divisor) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_RPIPERIPHERALPWM_H__*/ diff --git a/src/c/hardware/rasberrypi/libraries/wiringPi/wiringPi.h b/src/c/hardware/rasberrypi/libraries/wiringPi/wiringPi.h index e11a0be..a5eea87 100644 --- a/src/c/hardware/rasberrypi/libraries/wiringPi/wiringPi.h +++ b/src/c/hardware/rasberrypi/libraries/wiringPi/wiringPi.h @@ -24,17 +24,17 @@ #ifndef __WIRING_PI_H__ #define __WIRING_PI_H__ -// C doesn't have true/false by default and I can never remember which -// way round they are, so ... - +/* C doesn't have true/false by default and I can never remember which + way round they are, so ... +*/ #ifndef TRUE # define TRUE (1==1) # define FALSE (!TRUE) #endif -// Handy defines +/* Handy defines*/ -// wiringPi modes +/* wiringPi modes*/ #define WPI_MODE_PINS 0 #define WPI_MODE_GPIO 1 @@ -43,7 +43,7 @@ #define WPI_MODE_PIFACE 4 #define WPI_MODE_UNINITIALISED -1 -// Pin modes +/* Pin modes*/ #define INPUT 0 #define OUTPUT 1 @@ -56,27 +56,27 @@ #define LOW 0 #define HIGH 1 -// Pull up/down/none +/* Pull up/down/none*/ #define PUD_OFF 0 #define PUD_DOWN 1 #define PUD_UP 2 -// PWM +/* PWM*/ #define PWM_MODE_MS 0 #define PWM_MODE_BAL 1 -// Interrupt levels +/*Interrupt levels*/ #define INT_EDGE_SETUP 0 #define INT_EDGE_FALLING 1 #define INT_EDGE_RISING 2 #define INT_EDGE_BOTH 3 -// Pi model types and version numbers -// Intended for the GPIO program Use at your own risk. - +/*Pi model types and version numbers + Intended for the GPIO program Use at your own risk. +*/ #define PI_MODEL_A 0 #define PI_MODEL_B 1 #define PI_MODEL_AP 2 @@ -104,36 +104,36 @@ extern const char *piMakerNames [16] ; extern const int piMemorySize [ 8] ; -// Intended for the GPIO program Use at your own risk. +/* Intended for the GPIO program Use at your own risk.*/ -// Threads +/* Threads*/ #define PI_THREAD(X) void *X (void *dummy) -// Failure modes +/* Failure modes*/ #define WPI_FATAL (1==1) #define WPI_ALMOST (1==2) -// wiringPiNodeStruct: -// This describes additional device nodes in the extended wiringPi -// 2.0 scheme of things. -// It's a simple linked list for now, but will hopefully migrate to -// a binary tree for efficiency reasons - but then again, the chances -// of more than 1 or 2 devices being added are fairly slim, so who -// knows.... - +/*wiringPiNodeStruct: + This describes additional device nodes in the extended wiringPi + 2.0 scheme of things. + It's a simple linked list for now, but will hopefully migrate to + a binary tree for efficiency reasons - but then again, the chances + of more than 1 or 2 devices being added are fairly slim, so who + knows.... +*/ struct wiringPiNodeStruct { int pinBase ; int pinMax ; - int fd ; // Node specific - unsigned int data0 ; // ditto - unsigned int data1 ; // ditto - unsigned int data2 ; // ditto - unsigned int data3 ; // ditto + int fd ; /* Node specific*/ + unsigned int data0 ; /* ditto*/ + unsigned int data1 ; /* ditto*/ + unsigned int data2 ; /* ditto*/ + unsigned int data3 ; /* ditto*/ void (*pinMode) (struct wiringPiNodeStruct *node, int pin, int mode) ; void (*pullUpDnControl) (struct wiringPiNodeStruct *node, int pin, int mode) ; @@ -149,21 +149,21 @@ struct wiringPiNodeStruct extern struct wiringPiNodeStruct *wiringPiNodes ; -// Function prototypes -// c++ wrappers thanks to a comment by Nick Lott -// (and others on the Raspberry Pi forums) - +/*Function prototypes + c++ wrappers thanks to a comment by Nick Lott + (and others on the Raspberry Pi forums) +*/ #ifdef __cplusplus extern "C" { #endif -// Data +/* Data*/ -// Internal +/* Internal*/ extern int wiringPiFailure (int fatal, const char *message, ...) ; -// Core wiringPi functions +/* Core wiringPi functions*/ extern struct wiringPiNodeStruct *wiringPiFindNode (int pin) ; extern struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins) ; @@ -182,13 +182,13 @@ extern void pwmWrite (int pin, int value) ; extern int analogRead (int pin) ; extern void analogWrite (int pin, int value) ; -// PiFace specifics -// (Deprecated) +/* PiFace specifics + (Deprecated)*/ extern int wiringPiSetupPiFace (void) ; -extern int wiringPiSetupPiFaceForGpioProg (void) ; // Don't use this - for gpio program only +extern int wiringPiSetupPiFaceForGpioProg (void) ; /* Don't use this - for gpio program only*/ -// On-Board Raspberry Pi hardware specific stuff +/* On-Board Raspberry Pi hardware specific stuff*/ extern int piBoardRev (void) ; extern void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted) ; @@ -204,23 +204,23 @@ extern void pwmSetRange (unsigned int range) ; extern void pwmSetClock (int divisor) ; extern void gpioClockSet (int pin, int freq) ; -// Interrupts -// (Also Pi hardware specific) +/* Interrupts + (Also Pi hardware specific)*/ extern int waitForInterrupt (int pin, int mS) ; extern int wiringPiISR (int pin, int mode, void (*function)(void)) ; -// Threads +/* Threads*/ extern int piThreadCreate (void *(*fn)(void *)) ; extern void piLock (int key) ; extern void piUnlock (int key) ; -// Schedulling priority +/* Schedulling priority*/ extern int piHiPri (const int pri) ; -// Extras from arduino land +/* Extras from arduino land*/ extern void delay (unsigned int howLong) ; extern void delayMicroseconds (unsigned int howLong) ; diff --git a/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c new file mode 100644 index 0000000..883f3fa --- /dev/null +++ b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetClocks.c @@ -0,0 +1,27 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set clock for pwm channel. Default clock is 19.2 MHz. 'clk_divisor' + along with range decides frequency for PWM + PWM frequency = 19.2 MHz / clk_divisor/ range + Range for clk_divisor = 1-2048 + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +uint8 u8RPIHardPWMSetClocks(uint16 clk_divisor) +{ + pwmSetClock(clk_divisor); + + return 0; +} diff --git a/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c new file mode 100644 index 0000000..5a7ccd1 --- /dev/null +++ b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetModes.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set mode for PWM channel. Two modes are available + 0 --> balanced mode + 1 --> mark/space mode + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +uint8 u8RPIHardPWMSetModes(uint8 mode) +{ + if (mode == 1) /*mark/space mode*/ + pwmSetMode(PWM_MODE_MS); + else + pwmSetMode(PWM_MODE_BAL); + return 0; +} diff --git a/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c new file mode 100644 index 0000000..e3cda77 --- /dev/null +++ b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMSetRanges.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to assigne pwm duty to specified pin. PWM duty is decided by 'value' + and 'range' specified using corresponding function. + PWM duty = value/range + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" + +uint8 u8RPIHardPWMSetRanges(uint16 value) +{ + pwmSetRange(value); + return 0; +} diff --git a/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c new file mode 100644 index 0000000..546cfd5 --- /dev/null +++ b/src/c/hardware/rasberrypi/pwm/u8RPIHardPWMWrites.c @@ -0,0 +1,26 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function to set range for pwm channel. PWM duty is decided by 'range' + and 'value' specified using corresponding function. + PWM duty = value/range + */ + +#include "types.h" +#include "RPIPeripheralPWM.h" +#include "RPIPeripheralDigital.h" + +uint8 u8RPIHardPWMWrites(uint8 pin, uint16 value) +{ + pwmWrite((int)phy_pin[pin-1], value); + return 0; +} diff --git a/src/c/hardware/rasberrypi/serial/dRPISerialSendDatas.c b/src/c/hardware/rasberrypi/serial/dRPISerialSendDatas.c index 163e9c7..c1553f7 100644 --- a/src/c/hardware/rasberrypi/serial/dRPISerialSendDatas.c +++ b/src/c/hardware/rasberrypi/serial/dRPISerialSendDatas.c @@ -28,7 +28,7 @@ uint8 dRPISerialSendDatas(int fd, double data) for(count=0; count<sizeof(double); count++) { - //Send lsb first + /*Send lsb first*/ serialPutchar(fd, (uint8) in_data.bytes[count]); } diff --git a/src/c/hardware/rasberrypi/serial/i16RPISerialSendDatas.c b/src/c/hardware/rasberrypi/serial/i16RPISerialSendDatas.c index 861d7d8..ff6edff 100644 --- a/src/c/hardware/rasberrypi/serial/i16RPISerialSendDatas.c +++ b/src/c/hardware/rasberrypi/serial/i16RPISerialSendDatas.c @@ -17,7 +17,7 @@ uint8 i16RPISerialSendDatas(int fd, int16 data) { - //Send lsb first + /*Send lsb first*/ serialPutchar(fd, (uint8) data); serialPutchar(fd, (uint8) (data>>8)); diff --git a/src/c/hardware/rasberrypi/serial/sRPISerialSendDatas.c b/src/c/hardware/rasberrypi/serial/sRPISerialSendDatas.c index a8c34d0..bd0cd94 100644 --- a/src/c/hardware/rasberrypi/serial/sRPISerialSendDatas.c +++ b/src/c/hardware/rasberrypi/serial/sRPISerialSendDatas.c @@ -27,7 +27,7 @@ uint8 sRPISerialSendDatas(int fd, float data) for(count=0; count<sizeof(float); count++) { - //Send lsb first + /*Send lsb first*/ serialPutchar(fd, (uint8) in_data.bytes[count]); } diff --git a/src/c/hardware/rasberrypi/serial/u16RPISerialSendDatas.c b/src/c/hardware/rasberrypi/serial/u16RPISerialSendDatas.c index 5b2d056..2f0536c 100644 --- a/src/c/hardware/rasberrypi/serial/u16RPISerialSendDatas.c +++ b/src/c/hardware/rasberrypi/serial/u16RPISerialSendDatas.c @@ -17,7 +17,7 @@ uint8 u16RPISerialSendDatas(int fd, uint16 data) { - //Send lsb first + /*Send lsb first*/ serialPutchar(fd, (uint8) data); serialPutchar(fd, (uint8) (data>>8)); diff --git a/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c b/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c index d94beff..d0a063a 100644 --- a/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c +++ b/src/c/hardware/rasberrypi/threading/u16RPIThreadCreates.c @@ -15,7 +15,7 @@ #include "types.h" #include "RPIPeripheralThreading.h" -uint16 RPIThreadCreate(void (*threadFunction)) +uint16 RPIThreadCreate(void *(*threadFunction)(void)) { int status; status = piThreadCreate (threadFunction); diff --git a/src/c/hardware/rasberrypi/timing/u16RPIDelayMicros.c b/src/c/hardware/rasberrypi/timing/u16RPIDelayMicros.c index 48418c0..fe756c9 100644 --- a/src/c/hardware/rasberrypi/timing/u16RPIDelayMicros.c +++ b/src/c/hardware/rasberrypi/timing/u16RPIDelayMicros.c @@ -18,5 +18,6 @@ uint8 u16RPIDelayMicros(uint16 time) { delayMicroseconds(time); + return 0; } diff --git a/src/c/hardware/rasberrypi/timing/u16RPIDelayMillis.c b/src/c/hardware/rasberrypi/timing/u16RPIDelayMillis.c index 2dc59bb..d7be3f8 100644 --- a/src/c/hardware/rasberrypi/timing/u16RPIDelayMillis.c +++ b/src/c/hardware/rasberrypi/timing/u16RPIDelayMillis.c @@ -20,6 +20,6 @@ uint8 u16RPIDelayMillis(uint16 time) { delay(time); - + return 0; } diff --git a/src/c/imageProcessing/cvcore/imcvCreateImages.c b/src/c/imageProcessing/cvcore/imcvCreateImages.c new file mode 100644 index 0000000..a7eeaec --- /dev/null +++ b/src/c/imageProcessing/cvcore/imcvCreateImages.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to create openCV image object from given specifications*/ + +#include "types.h" +#include "cvcore.h" +#include <stdio.h> + +IplImage* imcvCreateImages(int width, int height, char *bit_depth, uint8 no_of_ch) +{ + CvSize imageSize = cvSize (width,height); + IplImage *img = NULL; + if (strcmp(bit_depth,"IPL_DEPTH_1U") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_1U,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_8U") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_8S") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_16U") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_16S") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_32U") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8U,no_of_ch); + else if (strcmp(bit_depth,"IPL_DEPTH_32S") == 0) + img = cvCreateImage(imageSize,IPL_DEPTH_8S,no_of_ch); + + return img; +}
\ No newline at end of file diff --git a/src/c/imageProcessing/cvhighgui/imcvLoadImages.c b/src/c/imageProcessing/cvhighgui/imcvLoadImages.c new file mode 100644 index 0000000..7c843f9 --- /dev/null +++ b/src/c/imageProcessing/cvhighgui/imcvLoadImages.c @@ -0,0 +1,23 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to load image object from given filename*/ + +#include "types.h" +#include "cvcore.h" +#include "cvhighgui.h" +#include <stdio.h> + +IplImage* imcvLoadImages(char *filename, uint8 opentype) +{ + return (cvLoadImage(filename,opentype)); +}
\ No newline at end of file diff --git a/src/c/imageProcessing/cvhighgui/imcvShowImages.c b/src/c/imageProcessing/cvhighgui/imcvShowImages.c new file mode 100644 index 0000000..82ae3ee --- /dev/null +++ b/src/c/imageProcessing/cvhighgui/imcvShowImages.c @@ -0,0 +1,25 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/* Function to create show an image */ + +#include "types.h" +#include "cvcore.h" +#include "cvhighgui.h" +#include <stdio.h> + +uint8 imcvShowImages(char *winname, IplImage* img) +{ + cvShowImage(winname,img); + + return (0); +}
\ No newline at end of file diff --git a/src/c/imageProcessing/includes/core.h b/src/c/imageProcessing/includes/core.h new file mode 100644 index 0000000..1e4c83c --- /dev/null +++ b/src/c/imageProcessing/includes/core.h @@ -0,0 +1,11 @@ + /* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ diff --git a/src/c/imageProcessing/includes/cvcore.h b/src/c/imageProcessing/includes/cvcore.h new file mode 100644 index 0000000..317d99b --- /dev/null +++ b/src/c/imageProcessing/includes/cvcore.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CVCORE_H__ +#define __CVCORE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" +#include "opencv2/core/core.hpp" + +IplImage* imcvCreateImages(int width, int height, char *bit_depth, uint8 no_of_ch); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CVCORE_H__*/ diff --git a/src/c/imageProcessing/includes/cvhighgui.h b/src/c/imageProcessing/includes/cvhighgui.h new file mode 100644 index 0000000..cae3dd1 --- /dev/null +++ b/src/c/imageProcessing/includes/cvhighgui.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __CVHIGHGUI_H__ +#define __CVHIGHGUI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" +#include "opencv2/core/core.hpp" +#include "opencv2/highgui.hpp" + +IplImage* imcvLoadImages(char *filename, uint8 opentype); +uint8 imcvShowImages(char *winname, IplImage* img); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__CVCORE_H__*/ diff --git a/src/c/imageProcessing/includes/temp.h b/src/c/imageProcessing/includes/temp.h new file mode 100644 index 0000000..1e4c83c --- /dev/null +++ b/src/c/imageProcessing/includes/temp.h @@ -0,0 +1,11 @@ + /* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in + */ diff --git a/src/c/imageProcessing/interfaces/int_cvcore.h b/src/c/imageProcessing/interfaces/int_cvcore.h new file mode 100644 index 0000000..9d83caa --- /dev/null +++ b/src/c/imageProcessing/interfaces/int_cvcore.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_CVCORE_H__ +#define __INT_CVCORE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" + + +#define d0d0g2d0CV_CreateImageim0(width,height,depth,depth_size,no_of_ch) \ + imcvCreateImages(width,height,depth,no_of_ch) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CVCORE_H__*/ diff --git a/src/c/imageProcessing/interfaces/int_cvhighgui.h b/src/c/imageProcessing/interfaces/int_cvhighgui.h new file mode 100644 index 0000000..f08ac40 --- /dev/null +++ b/src/c/imageProcessing/interfaces/int_cvhighgui.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +#ifndef __INT_CVHIGHGUI_H__ +#define __INT_CVHIGHGUI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "types.h" +#include "opencv2/highgui.hpp" + +#define g2d0CV_LoadImageim0(filename,name_size,loadtype) imcvLoadImages(filename,loadtype) +#define g2im0CV_ShowImageu80(winname,win_size,img) imcvShowImages(winname,img) +#define im0CV_ShowImageu80(img) imcvShowImages("",img) +#define d0CV_WaitKeyu80(delay) cvWaitKey(delay) +#define g2im0CV_SaveImageu80(filename,name_size,img) cvSaveImage(filename,img,NULL) + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /*__INT_CVHIGHGUI_H__*/ diff --git a/src/c/matrixOperations/cat/ccata.c b/src/c/matrixOperations/cat/ccata.c index 88106a8..a6ac6cf 100644 --- a/src/c/matrixOperations/cat/ccata.c +++ b/src/c/matrixOperations/cat/ccata.c @@ -26,7 +26,7 @@ void crowcata(floatComplex *in1, int lines1, int columns1, floatComplex *in2, i { for (j = 0 ; j < lines1 ; ++j) { - //out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; + /*out[i*(lines1 + lines2) + j] = in1[i*lines1 + j];*/ } for (j = 0 ; j < lines2 ; ++j) { diff --git a/src/c/matrixOperations/cat/zcata.c b/src/c/matrixOperations/cat/zcata.c index 30d50ee..bfb6e92 100644 --- a/src/c/matrixOperations/cat/zcata.c +++ b/src/c/matrixOperations/cat/zcata.c @@ -26,7 +26,7 @@ void zrowcata(doubleComplex *in1, int lines1, int columns1, doubleComplex *in2, { for (j = 0 ; j < lines1 ; ++j) { - //out[i*(lines1 + lines2) + j] = in1[i*lines1 + j]; + /*out[i*(lines1 + lines2) + j] = in1[i*lines1 + j];*/ } for (j = 0 ; j < lines2 ; ++j) { diff --git a/src/c/matrixOperations/cumprod/dcolumncumproda.c b/src/c/matrixOperations/cumprod/dcolumncumproda.c index 4eec55f..b64fac4 100644 --- a/src/c/matrixOperations/cumprod/dcolumncumproda.c +++ b/src/c/matrixOperations/cumprod/dcolumncumproda.c @@ -19,13 +19,13 @@ void dcolumncumproda(double *in1, int row, int column, double *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/drowcumproda.c b/src/c/matrixOperations/cumprod/drowcumproda.c index 80178b2..21082d0 100644 --- a/src/c/matrixOperations/cumprod/drowcumproda.c +++ b/src/c/matrixOperations/cumprod/drowcumproda.c @@ -19,12 +19,12 @@ void drowcumproda(double *in1, int row, int column, double *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumprod/i16columncumproda.c b/src/c/matrixOperations/cumprod/i16columncumproda.c index 81604bc..e5af54b 100644 --- a/src/c/matrixOperations/cumprod/i16columncumproda.c +++ b/src/c/matrixOperations/cumprod/i16columncumproda.c @@ -19,13 +19,13 @@ void i16columncumproda(int16 *in1, int row, int column, int16 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/i16rowcumproda.c b/src/c/matrixOperations/cumprod/i16rowcumproda.c index 175c864..0c38b5e 100644 --- a/src/c/matrixOperations/cumprod/i16rowcumproda.c +++ b/src/c/matrixOperations/cumprod/i16rowcumproda.c @@ -19,12 +19,12 @@ void i16rowcumproda(int16 *in1, int row, int column, int16 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumprod/i8columncumproda.c b/src/c/matrixOperations/cumprod/i8columncumproda.c index 4a5b45d..cf2156d 100644 --- a/src/c/matrixOperations/cumprod/i8columncumproda.c +++ b/src/c/matrixOperations/cumprod/i8columncumproda.c @@ -19,13 +19,13 @@ void i8columncumproda(int8 *in1, int row, int column, int8 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/i8rowcumproda.c b/src/c/matrixOperations/cumprod/i8rowcumproda.c index ac5eebe..c2ecf19 100644 --- a/src/c/matrixOperations/cumprod/i8rowcumproda.c +++ b/src/c/matrixOperations/cumprod/i8rowcumproda.c @@ -19,12 +19,12 @@ void i8rowcumproda(int8 *in1, int row, int column, int8 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumprod/scolumncumproda.c b/src/c/matrixOperations/cumprod/scolumncumproda.c index d720eb2..e97ca90 100644 --- a/src/c/matrixOperations/cumprod/scolumncumproda.c +++ b/src/c/matrixOperations/cumprod/scolumncumproda.c @@ -19,13 +19,13 @@ void scolumncumproda(float *in1, int row, int column, float *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/srowcumproda.c b/src/c/matrixOperations/cumprod/srowcumproda.c index d2f5db8..cab4e44 100644 --- a/src/c/matrixOperations/cumprod/srowcumproda.c +++ b/src/c/matrixOperations/cumprod/srowcumproda.c @@ -19,12 +19,12 @@ void srowcumproda(float *in1, int row, int column, float *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumprod/u16columncumproda.c b/src/c/matrixOperations/cumprod/u16columncumproda.c index 3f23bd7..7b3c2d8 100644 --- a/src/c/matrixOperations/cumprod/u16columncumproda.c +++ b/src/c/matrixOperations/cumprod/u16columncumproda.c @@ -19,13 +19,13 @@ void u16columncumproda(uint16 *in1, int row, int column, uint16 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/u16rowcumproda.c b/src/c/matrixOperations/cumprod/u16rowcumproda.c index 645c814..23b452c 100644 --- a/src/c/matrixOperations/cumprod/u16rowcumproda.c +++ b/src/c/matrixOperations/cumprod/u16rowcumproda.c @@ -19,12 +19,12 @@ void u16rowcumproda(uint16 *in1, int row, int column, uint16 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumprod/u8columncumproda.c b/src/c/matrixOperations/cumprod/u8columncumproda.c index 7c9a66a..3a6ee92 100644 --- a/src/c/matrixOperations/cumprod/u8columncumproda.c +++ b/src/c/matrixOperations/cumprod/u8columncumproda.c @@ -19,13 +19,13 @@ void u8columncumproda(uint8 *in1, int row, int column, uint8 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumprod/u8rowcumproda.c b/src/c/matrixOperations/cumprod/u8rowcumproda.c index 937d0a4..61b214c 100644 --- a/src/c/matrixOperations/cumprod/u8rowcumproda.c +++ b/src/c/matrixOperations/cumprod/u8rowcumproda.c @@ -19,12 +19,12 @@ void u8rowcumproda(uint8 *in1, int row, int column, uint8 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/dcolumncumsuma.c b/src/c/matrixOperations/cumsum/dcolumncumsuma.c index e26a9da..daf6013 100644 --- a/src/c/matrixOperations/cumsum/dcolumncumsuma.c +++ b/src/c/matrixOperations/cumsum/dcolumncumsuma.c @@ -19,13 +19,13 @@ void dcolumncumsuma(double *in1, int row, int column, double *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/drowcumsuma.c b/src/c/matrixOperations/cumsum/drowcumsuma.c index e523d67..4bb3f32 100644 --- a/src/c/matrixOperations/cumsum/drowcumsuma.c +++ b/src/c/matrixOperations/cumsum/drowcumsuma.c @@ -19,12 +19,12 @@ void drowcumsuma(double *in1, int row, int column, double *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/i16columncumsuma.c b/src/c/matrixOperations/cumsum/i16columncumsuma.c index 8f0dcb5..ae84428 100644 --- a/src/c/matrixOperations/cumsum/i16columncumsuma.c +++ b/src/c/matrixOperations/cumsum/i16columncumsuma.c @@ -19,13 +19,13 @@ void i16columncumsuma(int16 *in1, int row, int column, int16 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/i16rowcumsuma.c b/src/c/matrixOperations/cumsum/i16rowcumsuma.c index 9cd98c5..67cb9c7 100644 --- a/src/c/matrixOperations/cumsum/i16rowcumsuma.c +++ b/src/c/matrixOperations/cumsum/i16rowcumsuma.c @@ -19,12 +19,12 @@ void i16rowcumsuma(int16 *in1, int row, int column, int16 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/i8columncumsuma.c b/src/c/matrixOperations/cumsum/i8columncumsuma.c index c703049..67f72bc 100644 --- a/src/c/matrixOperations/cumsum/i8columncumsuma.c +++ b/src/c/matrixOperations/cumsum/i8columncumsuma.c @@ -19,13 +19,13 @@ void i8columncumsuma(int8 *in1, int row, int column, int8 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/i8rowcumsuma.c b/src/c/matrixOperations/cumsum/i8rowcumsuma.c index 017e920..a9e7da8 100644 --- a/src/c/matrixOperations/cumsum/i8rowcumsuma.c +++ b/src/c/matrixOperations/cumsum/i8rowcumsuma.c @@ -19,12 +19,12 @@ void i8rowcumsuma(int8 *in1, int row, int column, int8 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/scolumncumsuma.c b/src/c/matrixOperations/cumsum/scolumncumsuma.c index 108c2c7..a7e8a85 100644 --- a/src/c/matrixOperations/cumsum/scolumncumsuma.c +++ b/src/c/matrixOperations/cumsum/scolumncumsuma.c @@ -19,13 +19,13 @@ void scolumncumsuma(float *in1, int row, int column, float *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/srowcumsuma.c b/src/c/matrixOperations/cumsum/srowcumsuma.c index b5b968f..3af5d36 100644 --- a/src/c/matrixOperations/cumsum/srowcumsuma.c +++ b/src/c/matrixOperations/cumsum/srowcumsuma.c @@ -19,12 +19,12 @@ void srowcumsuma(float *in1, int row, int column, float *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/u16columncumsuma.c b/src/c/matrixOperations/cumsum/u16columncumsuma.c index 360caeb..aa16a58 100644 --- a/src/c/matrixOperations/cumsum/u16columncumsuma.c +++ b/src/c/matrixOperations/cumsum/u16columncumsuma.c @@ -19,13 +19,13 @@ void u16columncumsuma(uint16 *in1, int row, int column, uint16 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/u16rowcumsuma.c b/src/c/matrixOperations/cumsum/u16rowcumsuma.c index 75ff1e6..0ef0945 100644 --- a/src/c/matrixOperations/cumsum/u16rowcumsuma.c +++ b/src/c/matrixOperations/cumsum/u16rowcumsuma.c @@ -19,12 +19,12 @@ void u16rowcumsuma(uint16 *in1, int row, int column, uint16 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/cumsum/u8columncumsuma.c b/src/c/matrixOperations/cumsum/u8columncumsuma.c index a53467a..890a0be 100644 --- a/src/c/matrixOperations/cumsum/u8columncumsuma.c +++ b/src/c/matrixOperations/cumsum/u8columncumsuma.c @@ -19,13 +19,13 @@ void u8columncumsuma(uint8 *in1, int row, int column, uint8 *out) { int row_cnt, col_cnt = 0; - //Assign elements in first column as it is + /*Assign elements in first column as it is*/ for(row_cnt = 0; row_cnt < row; row_cnt++) { out[row_cnt] = in1[row_cnt]; } - //For second column onwards + /*For second column onwards*/ for (row_cnt = 0; row_cnt < row; row_cnt++) { for ( col_cnt = 1; col_cnt < column; col_cnt++) diff --git a/src/c/matrixOperations/cumsum/u8rowcumsuma.c b/src/c/matrixOperations/cumsum/u8rowcumsuma.c index 41553cd..1204d83 100644 --- a/src/c/matrixOperations/cumsum/u8rowcumsuma.c +++ b/src/c/matrixOperations/cumsum/u8rowcumsuma.c @@ -19,12 +19,12 @@ void u8rowcumsuma(uint8 *in1, int row, int column, uint8 *out) { int row_cnt, col_cnt = 0; - //assign elements in first row as it is + /*assign elements in first row as it is*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { out[col_cnt*row] = in1[col_cnt*row]; } - //For second row onwards + /*For second row onwards*/ for (col_cnt = 0; col_cnt < column; col_cnt++) { for ( row_cnt = 1; row_cnt < row; row_cnt++) diff --git a/src/c/matrixOperations/diag/ddiaga.c b/src/c/matrixOperations/diag/ddiaga.c index 26363ef..20f2039 100644 --- a/src/c/matrixOperations/diag/ddiaga.c +++ b/src/c/matrixOperations/diag/ddiaga.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void ddiaga(double in, int size,int insert_post,double *out) { diff --git a/src/c/matrixOperations/diag/ddiagina.c b/src/c/matrixOperations/diag/ddiagina.c index c4093b2..de19211 100644 --- a/src/c/matrixOperations/diag/ddiagina.c +++ b/src/c/matrixOperations/diag/ddiagina.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void ddiagina(double *in, int _row,int _column,int insert_post,double *out) { diff --git a/src/c/matrixOperations/diag/i16diaga.c b/src/c/matrixOperations/diag/i16diaga.c index 29f9290..b65822b 100644 --- a/src/c/matrixOperations/diag/i16diaga.c +++ b/src/c/matrixOperations/diag/i16diaga.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void i16diaga(int16 in, int size,int insert_post,int16 *out) { diff --git a/src/c/matrixOperations/diag/i16diagina.c b/src/c/matrixOperations/diag/i16diagina.c index 518f627..8a86c23 100644 --- a/src/c/matrixOperations/diag/i16diagina.c +++ b/src/c/matrixOperations/diag/i16diagina.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void i16diagina(int16 *in, int _row,int _column,int insert_post,int16 *out) { int i, j; diff --git a/src/c/matrixOperations/diag/i8diaga.c b/src/c/matrixOperations/diag/i8diaga.c index c41ec9d..50ba76e 100644 --- a/src/c/matrixOperations/diag/i8diaga.c +++ b/src/c/matrixOperations/diag/i8diaga.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void i8diaga(int8 in, int size,int insert_post,int8 *out) { diff --git a/src/c/matrixOperations/diag/i8diagina.c b/src/c/matrixOperations/diag/i8diagina.c index 77a7e07..eb005bf 100644 --- a/src/c/matrixOperations/diag/i8diagina.c +++ b/src/c/matrixOperations/diag/i8diagina.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void i8diagina(int8 *in, int _row,int _column,int insert_post,int8 *out) { int i, j; diff --git a/src/c/matrixOperations/diag/u16diaga.c b/src/c/matrixOperations/diag/u16diaga.c index 90a1053..18ff1bf 100644 --- a/src/c/matrixOperations/diag/u16diaga.c +++ b/src/c/matrixOperations/diag/u16diaga.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void u16diaga(uint16 in, int size,int insert_post,uint16 *out) { diff --git a/src/c/matrixOperations/diag/u16diagina.c b/src/c/matrixOperations/diag/u16diagina.c index f5dc6f9..02b52ec 100644 --- a/src/c/matrixOperations/diag/u16diagina.c +++ b/src/c/matrixOperations/diag/u16diagina.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void u16diagina(uint16 *in, int _row,int _column,int insert_post,uint16 *out) { int i, j; diff --git a/src/c/matrixOperations/diag/u8diaga.c b/src/c/matrixOperations/diag/u8diaga.c index 05a03ba..079e482 100644 --- a/src/c/matrixOperations/diag/u8diaga.c +++ b/src/c/matrixOperations/diag/u8diaga.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void u8diaga(uint8 in, int size,int insert_post,uint8 *out) { diff --git a/src/c/matrixOperations/diag/u8diagina.c b/src/c/matrixOperations/diag/u8diagina.c index bea2465..c9bf12e 100644 --- a/src/c/matrixOperations/diag/u8diagina.c +++ b/src/c/matrixOperations/diag/u8diagina.c @@ -11,7 +11,7 @@ */ #include "diag.h" -#include<stdlib.h> // Used for Absolute value of insert_post + void u8diagina(uint8 *in, int _row,int _column,int insert_post,uint8 *out) { int i, j; diff --git a/src/c/matrixOperations/flipdim/dflipdima.c b/src/c/matrixOperations/flipdim/dflipdima.c index 95eabc9..b510c44 100644 --- a/src/c/matrixOperations/flipdim/dflipdima.c +++ b/src/c/matrixOperations/flipdim/dflipdima.c @@ -1,22 +1,23 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void dflipdima (double *in, int row, int col, int dim, int blk_size, double *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +29,7 @@ void dflipdima (double *in, int row, int col, int dim, int blk_size, double *out } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +48,7 @@ void dflipdima (double *in, int row, int col, int dim, int blk_size, double *out } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/flipdim/i16flipdima.c b/src/c/matrixOperations/flipdim/i16flipdima.c index 281b39e..eb51221 100644 --- a/src/c/matrixOperations/flipdim/i16flipdima.c +++ b/src/c/matrixOperations/flipdim/i16flipdima.c @@ -1,22 +1,23 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void i16flipdima (int16 *in, int row, int col, int dim, int blk_size, int16 *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +29,7 @@ void i16flipdima (int16 *in, int row, int col, int dim, int blk_size, int16 *out } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +48,7 @@ void i16flipdima (int16 *in, int row, int col, int dim, int blk_size, int16 *out } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/flipdim/i8flipdima.c b/src/c/matrixOperations/flipdim/i8flipdima.c index fc302cb..1c23a5e 100644 --- a/src/c/matrixOperations/flipdim/i8flipdima.c +++ b/src/c/matrixOperations/flipdim/i8flipdima.c @@ -1,22 +1,23 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void i8flipdima (int8 *in, int row, int col, int dim, int blk_size, int8 *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +29,7 @@ void i8flipdima (int8 *in, int row, int col, int dim, int blk_size, int8 *out) } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +48,7 @@ void i8flipdima (int8 *in, int row, int col, int dim, int blk_size, int8 *out) } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/flipdim/sflipdima.c b/src/c/matrixOperations/flipdim/sflipdima.c index 588a72b..8574699 100644 --- a/src/c/matrixOperations/flipdim/sflipdima.c +++ b/src/c/matrixOperations/flipdim/sflipdima.c @@ -1,22 +1,23 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void sflipdima (float *in, int row, int col, int dim, int blk_size, float *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +29,7 @@ void sflipdima (float *in, int row, int col, int dim, int blk_size, float *out) } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +48,7 @@ void sflipdima (float *in, int row, int col, int dim, int blk_size, float *out) } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/flipdim/u16flipdima.c b/src/c/matrixOperations/flipdim/u16flipdima.c index fc1941e..3689b94 100644 --- a/src/c/matrixOperations/flipdim/u16flipdima.c +++ b/src/c/matrixOperations/flipdim/u16flipdima.c @@ -1,22 +1,23 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ + +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void u16flipdima (uint16 *in, int row, int col, int dim, int blk_size, uint16 *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +29,7 @@ void u16flipdima (uint16 *in, int row, int col, int dim, int blk_size, uint16 *o } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +48,7 @@ void u16flipdima (uint16 *in, int row, int col, int dim, int blk_size, uint16 *o } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/flipdim/u8flipdima.c b/src/c/matrixOperations/flipdim/u8flipdima.c index 61b8177..bae8c12 100644 --- a/src/c/matrixOperations/flipdim/u8flipdima.c +++ b/src/c/matrixOperations/flipdim/u8flipdima.c @@ -1,22 +1,22 @@ -// Copyright (C) 2016 - IIT Bombay - FOSSEE -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// Author: Siddhesh Wani -// Organization: FOSSEE, IIT Bombay -// Email: toolbox@scilab.in +/* Copyright (C) 2016 - IIT Bombay - FOSSEE -//Function flips the input matrix along given dimension + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at + http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt + Author: Siddhesh Wani + Organization: FOSSEE, IIT Bombay + Email: toolbox@scilab.in +*/ +/*Function flips the input matrix along given dimension*/ #include "flipdim.h" void u8flipdima (uint8 *in, int row, int col, int dim, int blk_size, uint8 *out) { int col_count = 0, row_count = 0, blk_count = 0, count = 0; - if(dim == 1) //flip rows + if(dim == 1) /*flip rows*/ { if(blk_size == 1) { @@ -28,7 +28,7 @@ void u8flipdima (uint8 *in, int row, int col, int dim, int blk_size, uint8 *out) } } } - else //block size is more than 1 + else /*block size is more than 1*/ { for(col_count = 0; col_count < col; col_count++) { @@ -47,7 +47,7 @@ void u8flipdima (uint8 *in, int row, int col, int dim, int blk_size, uint8 *out) } } - else if(dim == 2) //flip columns + else if(dim == 2) /*flip columns*/ { if(blk_size == 1) { diff --git a/src/c/matrixOperations/includes/diag.h b/src/c/matrixOperations/includes/diag.h index 24c167a..b255c4b 100644 --- a/src/c/matrixOperations/includes/diag.h +++ b/src/c/matrixOperations/includes/diag.h @@ -15,7 +15,8 @@ #include "dynlib_matrixoperations.h" #include "types.h" - +#include <stdlib.h> + #ifdef __cplusplus extern "C" { #endif diff --git a/src/c/matrixOperations/kron/dkrona.c b/src/c/matrixOperations/kron/dkrona.c index 6da6ed5..31e0a52 100644 --- a/src/c/matrixOperations/kron/dkrona.c +++ b/src/c/matrixOperations/kron/dkrona.c @@ -18,7 +18,7 @@ void dkrona (double *in1, int row1, int col1, double *in2, int row2, \ int col2, double *out) { int row1_count, col1_count,row2_count, col2_count; - int row = row1*row2, col = col1*col2; + int row = row1*row2; int temp = 0; for(col1_count = 0;col1_count < col1; col1_count++) diff --git a/src/c/matrixOperations/kron/skrona.c b/src/c/matrixOperations/kron/skrona.c index 7b154fe..1e0daaf 100644 --- a/src/c/matrixOperations/kron/skrona.c +++ b/src/c/matrixOperations/kron/skrona.c @@ -18,7 +18,7 @@ void skrona (float *in1, int row1, int col1, float *in2, int row2, \ int col2, float *out) { int row1_count, col1_count,row2_count, col2_count; - int row = row1*row2, col = col1*col2; + int row = row1*row2; int temp = 0; for(col1_count = 0;col1_count < col1; col1_count++) diff --git a/src/c/matrixOperations/multiplication/i16mulma.c b/src/c/matrixOperations/multiplication/i16mulma.c index ee1268a..b6b882d 100644 --- a/src/c/matrixOperations/multiplication/i16mulma.c +++ b/src/c/matrixOperations/multiplication/i16mulma.c @@ -11,7 +11,7 @@ ** \param out : Matrix that contains the multiplication in1 * in2. */ -// dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed +/* dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed*/ #include "matrixMultiplication.h" diff --git a/src/c/matrixOperations/multiplication/i8mulma.c b/src/c/matrixOperations/multiplication/i8mulma.c index 0efe797..4fdb203 100644 --- a/src/c/matrixOperations/multiplication/i8mulma.c +++ b/src/c/matrixOperations/multiplication/i8mulma.c @@ -11,7 +11,7 @@ ** \param out : Matrix that contains the multiplication in1 * in2. */ -// dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed +/* dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed*/ #include "matrixMultiplication.h" diff --git a/src/c/matrixOperations/multiplication/u16mulma.c b/src/c/matrixOperations/multiplication/u16mulma.c index a36c57c..11f88d8 100644 --- a/src/c/matrixOperations/multiplication/u16mulma.c +++ b/src/c/matrixOperations/multiplication/u16mulma.c @@ -11,7 +11,7 @@ ** \param out : Matrix that contains the multiplication in1 * in2. */ -// dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed +/* dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed*/ #include "matrixMultiplication.h" diff --git a/src/c/matrixOperations/multiplication/u8mulma.c b/src/c/matrixOperations/multiplication/u8mulma.c index ea630b6..3660249 100644 --- a/src/c/matrixOperations/multiplication/u8mulma.c +++ b/src/c/matrixOperations/multiplication/u8mulma.c @@ -12,7 +12,7 @@ */ -// dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed +/* dgemm function of lapack library does not support uint8,uint16,int8 and int16 datatype so removed*/ #include "matrixMultiplication.h" diff --git a/src/c/operations/interfaces/int_OpStar.h b/src/c/operations/interfaces/int_OpStar.h index f899a29..78697b3 100644 --- a/src/c/operations/interfaces/int_OpStar.h +++ b/src/c/operations/interfaces/int_OpStar.h @@ -35,41 +35,41 @@ #define u80u80OpStaru80(in1,in2) u8muls(in1, in2) -//#define u80u80OpStaru160(in1,in2) (uint16)(in1 * in2) +#define u80u80OpStaru160(in1,in2) (uint16)(in1 * in2) -//#define u80i80OpStari80(in1,in2) (int8)(in1 * in2) +#define u80i80OpStari80(in1,in2) (int8)(in1 * in2) -//#define u80i80OpStari160(in1,in2) (int16)(in1 * in2) +#define u80i80OpStari160(in1,in2) (int16)(in1 * in2) -//#define u80u160OpStaru160(in1,in2) (uint16)(in1 * in2) +#define u80u160OpStaru160(in1,in2) (uint16)(in1 * in2) -//#define u80i160OpStari160(in1,in2) (int16)(in1 * in2) +#define u80i160OpStari160(in1,in2) (int16)(in1 * in2) -//#define i80u80OpStari80(in1,in2) (int8)(in1 * in2) +#define i80u80OpStari80(in1,in2) (int8)(in1 * in2) -//#define i80u80OpStari160(in1,in2) (int16)(in1 * in2) +#define i80u80OpStari160(in1,in2) (int16)(in1 * in2) #define i80i80OpStari80(in1,in2) (int8)(in1 , in2) -//#define i80i80OpStari160(in1,in2) (int16)(in1 * in2) +#define i80i80OpStari160(in1,in2) (int16)(in1 * in2) -//#define i80u160OpStari160(in1,in2) (int16)(in1 * in2) +#define i80u160OpStari160(in1,in2) (int16)(in1 * in2) -//#define i80i160OpStari160(in1,in2) (int16)(in1 * in2) +#define i80i160OpStari160(in1,in2) (int16)(in1 * in2) -//#define u160u80OpStaru160(in1,in2) (uint16)(in1 * in2) +#define u160u80OpStaru160(in1,in2) (uint16)(in1 * in2) -//#define u160i80OpStari160(in1,in2) (int16)(in1 * in2) +#define u160i80OpStari160(in1,in2) (int16)(in1 * in2) #define u160u160OpStaru160(in1,in2) u16muls(in1 , in2) -//#define u160i160OpStari160(in1,in2) (int16)(in1 * in2) +#define u160i160OpStari160(in1,in2) (int16)(in1 * in2) -//#define i160u80OpStari160(in1,in2) (int16)(in1 * in2) +#define i160u80OpStari160(in1,in2) (int16)(in1 * in2) -//#define i160i80OpStari160(in1,in2) (int16)(in1 * in2) +#define i160i80OpStari160(in1,in2) (int16)(in1 * in2) -//#define i160u160OpStari160(in1,in2) (int16)(in1 * in2) +#define i160u160OpStari160(in1,in2) (int16)(in1 * in2) #define i160i160OpStari160(in1,in2) i16muls(in1 , in2) diff --git a/src/c/statisticsFunctions/includes/statMax.h b/src/c/statisticsFunctions/includes/statMax.h index 7ac659c..c3f1909 100644 --- a/src/c/statisticsFunctions/includes/statMax.h +++ b/src/c/statisticsFunctions/includes/statMax.h @@ -12,8 +12,7 @@ #ifndef __STAT_MAX_H__ #define __STAT_MAX_H__ -//#ifndef __MAX_H__ -//#define __MAX_H__ + #include "dynlib_statisticsfunctions.h" #include "types.h" diff --git a/src/c/statisticsFunctions/includes/statMin.h b/src/c/statisticsFunctions/includes/statMin.h index 4381abd..ac73285 100644 --- a/src/c/statisticsFunctions/includes/statMin.h +++ b/src/c/statisticsFunctions/includes/statMin.h @@ -12,8 +12,7 @@ #ifndef __STAT_MIN_H__ #define __STAT_MIN_H__ -//#ifndef __MIN_H__ -//#define __MIN_H__ + #include "dynlib_statisticsfunctions.h" #include "types.h" diff --git a/src/c/statisticsFunctions/max/dcolumnmaxa.c b/src/c/statisticsFunctions/max/dcolumnmaxa.c index e66422a..ec71777 100644 --- a/src/c/statisticsFunctions/max/dcolumnmaxa.c +++ b/src/c/statisticsFunctions/max/dcolumnmaxa.c @@ -11,7 +11,6 @@ */ #include "statMax.h" -//#include "max.h" void dcolumnmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/dmaxa.c b/src/c/statisticsFunctions/max/dmaxa.c index 6364463..7292f3c 100644 --- a/src/c/statisticsFunctions/max/dmaxa.c +++ b/src/c/statisticsFunctions/max/dmaxa.c @@ -11,7 +11,7 @@ */ #include "statMax.h" -//#include "max.h" + double dmaxa(double *in, int size) { double out = in[0]; int i = 0; diff --git a/src/c/statisticsFunctions/max/drowmaxa.c b/src/c/statisticsFunctions/max/drowmaxa.c index db0c72c..596c535 100644 --- a/src/c/statisticsFunctions/max/drowmaxa.c +++ b/src/c/statisticsFunctions/max/drowmaxa.c @@ -11,7 +11,7 @@ */ #include "statMax.h" -//#include "max.h" + void drowmaxa(double *in, int rows, int columns, double* out) { int i = 0, j = 0; for (i = 0; i < columns; i++) diff --git a/src/c/statisticsFunctions/max/i16columnmaxa.c b/src/c/statisticsFunctions/max/i16columnmaxa.c index 94c5cf6..a3af3a4 100644 --- a/src/c/statisticsFunctions/max/i16columnmaxa.c +++ b/src/c/statisticsFunctions/max/i16columnmaxa.c @@ -11,7 +11,7 @@ */ #include "statMax.h" -//#include "max.h" + void i16columnmaxa(int16 *in, int rows, int columns, int16* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/i16maxa.c b/src/c/statisticsFunctions/max/i16maxa.c index c129419..515071d 100644 --- a/src/c/statisticsFunctions/max/i16maxa.c +++ b/src/c/statisticsFunctions/max/i16maxa.c @@ -11,7 +11,7 @@ */ #include "statMax.h" -//#include "max.h" + int16 i16maxa(int16 *in, int size) { int16 out = in[0]; int i = 0; diff --git a/src/c/statisticsFunctions/max/i16rowmaxa.c b/src/c/statisticsFunctions/max/i16rowmaxa.c index 263e56c..317942e 100644 --- a/src/c/statisticsFunctions/max/i16rowmaxa.c +++ b/src/c/statisticsFunctions/max/i16rowmaxa.c @@ -11,7 +11,6 @@ */ #include "statMax.h" -//#include "max.h" void i16rowmaxa(int16 *in, int rows, int columns, int16* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/i8columnmaxa.c b/src/c/statisticsFunctions/max/i8columnmaxa.c index 9c214db..0d46f78 100644 --- a/src/c/statisticsFunctions/max/i8columnmaxa.c +++ b/src/c/statisticsFunctions/max/i8columnmaxa.c @@ -11,7 +11,6 @@ */ #include "statMax.h" -//#include "max.h" void i8columnmaxa(int8 *in, int rows, int columns, int8* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/i8maxa.c b/src/c/statisticsFunctions/max/i8maxa.c index 67fd335..bccb857 100644 --- a/src/c/statisticsFunctions/max/i8maxa.c +++ b/src/c/statisticsFunctions/max/i8maxa.c @@ -10,7 +10,6 @@ * */ #include "statMax.h" -//#include "max.h" int8 i8maxa(int8 *in, int size) { int8 out = in[0]; diff --git a/src/c/statisticsFunctions/max/i8rowmaxa.c b/src/c/statisticsFunctions/max/i8rowmaxa.c index a6d15aa..44ca17a 100644 --- a/src/c/statisticsFunctions/max/i8rowmaxa.c +++ b/src/c/statisticsFunctions/max/i8rowmaxa.c @@ -11,7 +11,6 @@ */ #include "statMax.h" -//#include "max.h" void i8rowmaxa(int8 *in, int rows, int columns, int8* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/scolumnmaxa.c b/src/c/statisticsFunctions/max/scolumnmaxa.c index 4014f88..185ab98 100644 --- a/src/c/statisticsFunctions/max/scolumnmaxa.c +++ b/src/c/statisticsFunctions/max/scolumnmaxa.c @@ -11,7 +11,6 @@ */ #include "statMax.h" -//#include "max.h" void scolumnmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/smaxa.c b/src/c/statisticsFunctions/max/smaxa.c index 03b4cf1..3410fae 100644 --- a/src/c/statisticsFunctions/max/smaxa.c +++ b/src/c/statisticsFunctions/max/smaxa.c @@ -10,7 +10,7 @@ * */ #include "statMax.h" -//#include "max.h" + float smaxa(float *in, int size) { float out = in[0]; diff --git a/src/c/statisticsFunctions/max/srowmaxa.c b/src/c/statisticsFunctions/max/srowmaxa.c index ea6c33d..8f3b30e 100644 --- a/src/c/statisticsFunctions/max/srowmaxa.c +++ b/src/c/statisticsFunctions/max/srowmaxa.c @@ -10,7 +10,7 @@ * */ #include "statMax.h" -//#include "max.h" + void srowmaxa(float *in, int rows, int columns, float* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/u16columnmaxa.c b/src/c/statisticsFunctions/max/u16columnmaxa.c index e0ccb3a..91f950d 100644 --- a/src/c/statisticsFunctions/max/u16columnmaxa.c +++ b/src/c/statisticsFunctions/max/u16columnmaxa.c @@ -12,8 +12,6 @@ #include "statMax.h" -//#include "max.h" - void u16columnmaxa(uint16 *in, int rows, int columns, uint16* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/u16maxa.c b/src/c/statisticsFunctions/max/u16maxa.c index c3af84f..5c1b136 100644 --- a/src/c/statisticsFunctions/max/u16maxa.c +++ b/src/c/statisticsFunctions/max/u16maxa.c @@ -10,7 +10,6 @@ * */ #include "statMax.h" -//#include "max.h" uint16 u16maxa(uint16 *in, int size) { uint16 out = in[0]; diff --git a/src/c/statisticsFunctions/max/u16rowmaxa.c b/src/c/statisticsFunctions/max/u16rowmaxa.c index cef61f1..c3b8917 100644 --- a/src/c/statisticsFunctions/max/u16rowmaxa.c +++ b/src/c/statisticsFunctions/max/u16rowmaxa.c @@ -10,8 +10,6 @@ * */ #include "statMax.h" -//#include <stdlib.h> -//#include "max.h" void u16rowmaxa(uint16 *in, int rows, int columns, uint16* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/u8columnmaxa.c b/src/c/statisticsFunctions/max/u8columnmaxa.c index 222bc29..fb90ae3 100644 --- a/src/c/statisticsFunctions/max/u8columnmaxa.c +++ b/src/c/statisticsFunctions/max/u8columnmaxa.c @@ -10,7 +10,7 @@ * */ #include "statMax.h" -//#include "max.h" + void u8columnmaxa(uint8 *in, int rows, int columns, uint8* out) { int i = 0, j = 0; diff --git a/src/c/statisticsFunctions/max/u8maxa.c b/src/c/statisticsFunctions/max/u8maxa.c index 3e59915..51e0dea 100644 --- a/src/c/statisticsFunctions/max/u8maxa.c +++ b/src/c/statisticsFunctions/max/u8maxa.c @@ -11,7 +11,7 @@ */ #include "statMax.h" -//#include "max.h" + uint8 u8maxa(uint8 *in, int size) { uint8 out = in[0]; int i = 0; diff --git a/src/c/statisticsFunctions/max/u8rowmaxa.c b/src/c/statisticsFunctions/max/u8rowmaxa.c index fda293c..57c62f4 100644 --- a/src/c/statisticsFunctions/max/u8rowmaxa.c +++ b/src/c/statisticsFunctions/max/u8rowmaxa.c @@ -10,7 +10,7 @@ * */ #include "statMax.h" -//#include "max.h" + void u8rowmaxa(uint8 *in, int rows, int columns, uint8* out) { int i = 0, j = 0; |