diff options
Diffstat (limited to '2.3-1/macros')
64 files changed, 462 insertions, 96 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex 12f738d4..8b3ce654 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 69fbb82e..f9515cd1 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -40,12 +40,13 @@ SCI2CNInArgCheck(argn(2),3,3); // ----------------------- // --- Initialization. --- // ----------------------- -nxtscifunname = SharedInfo.NextSCIFunName; -nxtscifunnumber = SharedInfo.NextSCIFunNumber; -ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; -Pass1HeaderFileName = FileInfo.Funct(nxtscifunnumber).Pass1HeaderFileName; -FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir; -CGblDeclarFileName = FileInfo.Funct(nxtscifunnumber).CGblDeclarFileName; +nxtscifunname = SharedInfo.NextSCIFunName; +nxtscifunnumber = SharedInfo.NextSCIFunNumber; +ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; +Pass1HeaderFileName = FileInfo.Funct(nxtscifunnumber).Pass1HeaderFileName; +FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir; +CGblDeclarFileName = FileInfo.Funct(nxtscifunnumber).CGblDeclarFileName; +PeripheralInitListFile = FileInfo.PeripheralInitListFile; Flag_FunAlreadyCalled = 0; // #RNU_RES_B @@ -101,6 +102,11 @@ elseif (ASTFunName == 'global') PrintStringInfo(' ',ReportFileName,'both','y'); error(9999, 'SCI2CERROR: Unexpected number of output arguments for global function.'); end +//elseif(IsAVRSupportFunction(ASTFunName)) + //Get the peripheral from function name and input arguements, insert it in + //list of used peripherals. + // PeripheralUsed=GetPeripheral(ASTFunName,InArg); + // InsertPeripheralInList(PeripheralUsed,PeripheralInitListFile); end // #RNU_RES_B diff --git a/2.3-1/macros/ASTManagement/lib b/2.3-1/macros/ASTManagement/lib Binary files differindex ccecc91e..4cd697ce 100644 --- a/2.3-1/macros/ASTManagement/lib +++ b/2.3-1/macros/ASTManagement/lib diff --git a/2.3-1/macros/ASTManagement/names b/2.3-1/macros/ASTManagement/names index 3e6bfa8c..7f6d053d 100644 --- a/2.3-1/macros/ASTManagement/names +++ b/2.3-1/macros/ASTManagement/names @@ -1,44 +1,44 @@ -AST_ParseOperStruct -AST_HandleEOL -AST_ReadEqualRhsNames -AST_HandleFor +%comment_string +%cste_string +%equal_string +%for_string +%funcall_string +%ifthenel_string +%operatio_string +%program_p +%program_string %variable_string -AST_GetASTFile -AST_HandleEndFor +%while_string AST2Ccode -AST_GetFuncallPrm -AST_HandleEndGenFun +AST_CheckCommonInOutArgs +AST_CheckLastFunc AST_CheckLineLength -SciFile2ASTFile AST_CheckPrecSpecifier -%operatio_string -AST_HandleIfElse +AST_DisplayStack +AST_ExtractNameAndScope +AST_GetASTFile +AST_GetFuncallPrm +AST_GetPrecAndLhsArg +AST_HandleEOL +AST_HandleEndFor +AST_HandleEndGenFun +AST_HandleEndProgram AST_HandleEndWhile -AST_CheckCommonInOutArgs -AST_HandleWhileStatem +AST_HandleFor AST_HandleForStatem -%ifthenel_string +AST_HandleHeader +AST_HandleIfElse +AST_HandleWhileExpr +AST_HandleWhileStatem AST_ParseEqualStruct -%while_string -AST_GetPrecAndLhsArg -AST_ExtractNameAndScope -objectlist2string -%comment_string +AST_ParseFuncallStruct +AST_ParseIfExprStruct +AST_ParseOperStruct AST_PopASTStack -AST_CheckLastFunc -GenOutArgNames -%equal_string -AST_ReadASTHeader -%cste_string -AST_HandleEndProgram AST_PushASTStack -AST_DisplayStack -%funcall_string -AST_HandleWhileExpr -AST_ParseFuncallStruct +AST_ReadASTHeader +AST_ReadEqualRhsNames +GenOutArgNames Operator2FunName -%program_p -AST_HandleHeader -AST_ParseIfExprStruct -%program_string -%for_string +SciFile2ASTFile +objectlist2string diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin Binary files differindex e262750a..40a8771d 100644 --- a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin +++ b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin diff --git a/2.3-1/macros/CCodeGeneration/C_Funcall.sci b/2.3-1/macros/CCodeGeneration/C_Funcall.sci index b130a622..166799e6 100644 --- a/2.3-1/macros/CCodeGeneration/C_Funcall.sci +++ b/2.3-1/macros/CCodeGeneration/C_Funcall.sci @@ -35,7 +35,7 @@ CDeclarationFileName = FileInfo.Funct(nxtscifunnumber).CDeclarationFileName; CInitVarsFileName = FileInfo.Funct(nxtscifunnumber).CInitVarsFileName; IndentLevel = SharedInfo.NIndent; CCall = ''; - +OutFormat = SharedInfo.OutFormat; // --- Extract Function Info. --- FunctionName = FunInfo.SCIFunctionName; CFunName = FunInfo.CFunctionName; @@ -371,7 +371,7 @@ else if (FlagCall == 0) // Add prototype to the header file - C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName); + C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName,OutFormat); // Add { at the beginning of the function. PrintStringInfo(' {',ReportFileName,'file','y'); diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex eb01ef65..98734690 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin Binary files differindex 45bb3564..72c7943e 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci index 41e13e45..1c2efd6a 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci @@ -1,4 +1,4 @@ -function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName) +function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName,OutFormat) // function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName) // ----------------------------------------------------------------- // //NUT: add description here @@ -51,6 +51,12 @@ PrintStringInfo('extern ""C"" {',HeaderFileName,'file','y'); PrintStringInfo('#endif',HeaderFileName,'file','y'); PrintStringInfo('/*',HeaderFileName,'file','y'); PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); +PrintStringInfo('** ----- Target ------ ',HeaderFileName,'file','y'); +PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); +PrintStringInfo('*/',HeaderFileName,'file','y'); +PrintStringInfo('# define ' + OutFormat + '1' ,HeaderFileName,'file','y'); +PrintStringInfo('/*',HeaderFileName,'file','y'); +PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** --- Prototypes. --- ',HeaderFileName,'file','y'); PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('*/',HeaderFileName,'file','y'); diff --git a/2.3-1/macros/CCodeGeneration/C_Type.bin b/2.3-1/macros/CCodeGeneration/C_Type.bin Binary files differindex 00c10704..c2ff6e65 100644 --- a/2.3-1/macros/CCodeGeneration/C_Type.bin +++ b/2.3-1/macros/CCodeGeneration/C_Type.bin diff --git a/2.3-1/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin b/2.3-1/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin Binary files differindex 026863b2..61f446f3 100644 --- a/2.3-1/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin +++ b/2.3-1/macros/FunctionAnnotation/FA_GetDefaultPrecision.bin diff --git a/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differindex 78fb2f09..50f6251b 100644 --- a/2.3-1/macros/FunctionAnnotation/lib +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionAnnotation/names b/2.3-1/macros/FunctionAnnotation/names index e95bff5f..d9300d20 100644 --- a/2.3-1/macros/FunctionAnnotation/names +++ b/2.3-1/macros/FunctionAnnotation/names @@ -1,55 +1,55 @@ -FA_SZ_OPRC -FA_SZ_OPLOGEQ -FA_SZ_OPLOGLT +FA_ADD FA_DIV -FA_SZ_OPCC -FA_SZ_OPPLUS -FA_TP_Z -FA_SZ_OPLOGGE -FA_MIN -FA_MUL -FA_SZ_OPLOGOR -FA_SZ_OPSTAR -FA_SZ_OPMINUS -FA_SZ_SEL1 -FA_SZ_OPLOGNE -FA_SZ_OPSLASH -FA_SZ_OPDOTAPEX -FA_SZ_OPBACKSLASH -FA_GetFunAnn -FA_SZ_OPDOTSLASH -FA_SZ_OPPLUSA -FA_MAX FA_GetDefaultPrecision -FA_SZ_OPHAT -FA_TP_C +FA_GetFunAnn +FA_GetOutArgInfo +FA_GetResizeApproach FA_INT -FA_TP_REAL -FA_TP_USER +FA_MAX +FA_MIN +FA_MUL FA_REAL -FA_TP_COMPLEX -FA_ADD -FA_TP_MIN_REAL +FA_SUB FA_SZ_1 -FA_SZ_OPDOTHAT -FA_SZ_OPDOTBACKSLASH -FA_TP_I +FA_SZ_2 FA_SZ_FROM_VAL +FA_SZ_OPAPEX +FA_SZ_OPBACKSLASH +FA_SZ_OPCC +FA_SZ_OPDOTAPEX +FA_SZ_OPDOTBACKSLASH +FA_SZ_OPDOTHAT +FA_SZ_OPDOTSLASH +FA_SZ_OPDOTSTAR +FA_SZ_OPHAT FA_SZ_OPLOGAND -FA_GetOutArgInfo -FA_TP_S -FA_TP_D -FA_TP_MAX -FA_SZ_2 -FA_SZ_SEL2 -FA_GetResizeApproach +FA_SZ_OPLOGEQ +FA_SZ_OPLOGGE FA_SZ_OPLOGGT -FA_SZ_OPDOTSTAR -FA_SUB -FA_SZ_OPLOGNOT FA_SZ_OPLOGLE -FA_SZ_OPAPEX -FA_TP_UINT8 +FA_SZ_OPLOGLT +FA_SZ_OPLOGNE +FA_SZ_OPLOGNOT +FA_SZ_OPLOGOR +FA_SZ_OPMINUS +FA_SZ_OPPLUS +FA_SZ_OPPLUSA +FA_SZ_OPRC +FA_SZ_OPSLASH +FA_SZ_OPSTAR +FA_SZ_SEL1 +FA_SZ_SEL2 +FA_TP_C +FA_TP_COMPLEX +FA_TP_D +FA_TP_I +FA_TP_INT16 FA_TP_INT8 +FA_TP_MAX +FA_TP_MIN_REAL +FA_TP_REAL +FA_TP_S +FA_TP_UINT16 FA_TP_UINT8 -FA_TP_INT16 +FA_TP_USER +FA_TP_Z diff --git a/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci new file mode 100644 index 00000000..d9897fc3 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRADCSetup.sci @@ -0,0 +1,32 @@ +function AVRADCSetup(prescalar,adc_ref) +// Function to initialise ADC of AVR +// +// Calling Sequence +// AVRSetupADC(uint8 prescalar, uint8 adc_ref) +// +// Parameters +// prescalar: prescalar to be used for generating ADC clock (0-7) +// adc_ref : reference voltage to be used for ADC conversion +// 0 -> Voltage on VREF pin +// 1 -> Voltage on AVCC pin +// 2 -> Internal 2.56 reference voltage +// +// Description +// This function initialises ADc of AVR with given parameters. 'prescalar' is +// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz +// and it given as (MCU clock/2^prescalar). Select appropriate prescalar depending +// on MCU clock. 'adc_ref' selects one of the available reference voltage sources +// available +// Examples +// AVRADCSetup(128,0) + +// See also +// AVRReadADC +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalOut.bin b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.bin Binary files differnew file mode 100644 index 00000000..7a09b0d8 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.bin diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci new file mode 100644 index 00000000..f17c8a07 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalOut.sci @@ -0,0 +1,32 @@ +function AVRDigitalOut(port,pin,state) +// Function to change state (high\low) of a digital output pin on AVR +// +// Calling Sequence +// AVRDigitalOut(port,pin,state) +// +// Parameters +// port : port of microcontroller to be used +// pin : pin of port (mentioned above) to be used +// state : state to be outputed on pin (HIGH\LOW) +// +// Description +// Each AVR microcontroller has pins which can be configured as digital +// outputs. These are normally divided among some 'ports' (group of pins). +// User has to select one of these port and which pin of that port as +// digital output. Also, desired output state must be specified as +// 'HIGH' or 'LOW'. +// +// Examples +// AVRDigitalOut('A',0,HIGH) +// +// See also +// AVRDigitalIn +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.bin b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.bin Binary files differnew file mode 100644 index 00000000..98a592e3 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.bin diff --git a/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci new file mode 100644 index 00000000..3de56c21 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRDigitalSetup.sci @@ -0,0 +1,32 @@ +function AVRDigitalSetup(port,pin,direction) +// Function to decide direction of a digital pin on AVR +// +// Calling Sequence +// AVRDigitalSetup(port,pin,direction) +// +// Parameters +// port : port of microcontroller to be used +// pin : pin of port (mentioned above) to be used +// direction : direction to be set for pin (INPUT\OUTPUT) +// +// Description +// Each AVR microcontroller has pins which can be configured as digital +// outputs/inputs. These are normally divided among some 'ports' (group of pins). +// User has to select one of these port and which pin of that port to be +// used as digital output/input. Also, desired direction must be specified as +// 'INPUT' or 'OUTPUT'. +// +// Examples +// AVRDigitalSetup('A',0,OUTPUT) +// +// See also +// AVRDigitalIn AVRDigitalOut +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/AVRReadADC.sci b/2.3-1/macros/Hardware/AVR/AVRReadADC.sci new file mode 100644 index 00000000..f9dfdac0 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRReadADC.sci @@ -0,0 +1,31 @@ +function AVRReadADC(channel) +// Function to get voltage on analog pin on AVR +// +// Calling Sequence +// u8AVRReadADCs(channel) +// +// Parameters +// channel : Select which channel is to be read. Values from 0-7 select one +// of the pins ADC0-ADC7. For other possible channel values refer +// datasheet +// Returns-> +// result : Digital value for the voltage present on channel selected +// +// Description +// This function returns digital value for present on adc pins. 'channel' +// selects which of the ADC0-ADC7 is to be used for reading analog value. +// Apart from reading just ADC0-ADC7 other it can also read differential +// voltages between some pins. For channel values for those options, please +// refer datasheet. +// +// Examples +// adc_result = u8AVRReadADC(0) //Read ADC0 +// +// Authors +// Siddhesh Wani +// + + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for AVR. +endfunction diff --git a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin Binary files differnew file mode 100644 index 00000000..eed8be3b --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.bin diff --git a/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci new file mode 100644 index 00000000..50a913fa --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/GetAVRSupportFunctions.sci @@ -0,0 +1,16 @@ +function AVRSupportFunctions = GetAVRSupportFunctions() +// ----------------------------------------------------------------- +// Get list of AVR peripherals supported +// +// Input data: +// None +// +// Output data: +// None +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +AVRSupportFunctions = ["AVRDigitalOut"]; + +endfunction diff --git a/2.3-1/macros/Hardware/AVR/GetPeripheral.bin b/2.3-1/macros/Hardware/AVR/GetPeripheral.bin Binary files differnew file mode 100644 index 00000000..b496bbb0 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/GetPeripheral.bin diff --git a/2.3-1/macros/Hardware/AVR/GetPeripheral.sci b/2.3-1/macros/Hardware/AVR/GetPeripheral.sci new file mode 100644 index 00000000..73e9f19e --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/GetPeripheral.sci @@ -0,0 +1,21 @@ +function Peripheral = GetPeripheral(FunName,InArg) +// ----------------------------------------------------------------- +// Get an acronym for peripheral being used to be inserted in list of +// used peripherals +// +// Input data: +// FunName: Name of the function to be checked +// InArg:Input arguements passed to function 'FunName' +// +// Output data: +// Peripheral: Acronym for peripheral to be initialised +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +//select FunName + +//case AVRDigitalOut: +// Peripheral = list('PORT', InArg(1),InArg(2)]; +//end +endfunction diff --git a/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.bin b/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.bin Binary files differnew file mode 100644 index 00000000..c49f4e04 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.bin diff --git a/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.sci b/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.sci new file mode 100644 index 00000000..bafc5935 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/InsertPeripheralInList.sci @@ -0,0 +1,17 @@ +function InsertPeripheralInList(Peripheral,PeripheralListFile) +// ----------------------------------------------------------------- +// Insert input peripheral in peripherals' list +// +// Input data: +// Peripheral: Peripheral of type 'list' to be instertd in list +// PeripheralListFile: Name of file containing list of peripheral used +// +// Output data: +// None +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +load(PeripheralListFile,'PheripheralList'); + +endfunction diff --git a/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.bin b/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.bin Binary files differnew file mode 100644 index 00000000..e2382308 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.bin diff --git a/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.sci b/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.sci new file mode 100644 index 00000000..a4cbbc88 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/IsAVRSupportFunction.sci @@ -0,0 +1,22 @@ +function Output = IsAVRSupportFunction(FunName) +// ----------------------------------------------------------------- +// Check whether input function name is an AVR support function or not. +// +// Input data: +// FunName: Name of the function to be checked +// +// Output data: +// Output: True or False depending whether given function is an AVR +// support functions or not +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +//Get list of supported functions for AVR +AVRSupportFunctions = GetAVRSupportFunctions(); + +//Check whether input function is present in above list or not +FunNameInAVRSupport = members(FunName,AVRSupportFunctions); +Output = bool2s(FunNameInAVRSupport~=0); + +endfunction diff --git a/2.3-1/macros/Hardware/AVR/buildmacros.sce b/2.3-1/macros/Hardware/AVR/buildmacros.sce new file mode 100644 index 00000000..60fd2843 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/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/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differnew file mode 100644 index 00000000..097a89f0 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/lib diff --git a/2.3-1/macros/Hardware/AVR/names b/2.3-1/macros/Hardware/AVR/names new file mode 100644 index 00000000..4b941e9b --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/names @@ -0,0 +1,6 @@ +AVRDigitalOut +AVRDigitalSetup +GetAVRSupportFunctions +GetPeripheral +InsertPeripheralInList +IsAVRSupportFunction diff --git a/2.3-1/macros/Hardware/buildmacros.sce b/2.3-1/macros/Hardware/buildmacros.sce new file mode 100644 index 00000000..88f0fb2a --- /dev/null +++ b/2.3-1/macros/Hardware/buildmacros.sce @@ -0,0 +1,19 @@ +// This file is released into the public domain + +Directories = [ "AVR" ]; + + +current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); + +for K=1:size(Directories,"*") + myfile = current_path_buildmacros + filesep() + Directories(K) + filesep() + "buildmacros.sce"; + if isfile(myfile) then + exec(myfile); + end +end + +clear current_path_buildmacros; + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin Binary files differindex 5c17670b..14dfb49c 100644 --- a/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_CreateDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex 68968b59..a85721c0 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 792ef653..6a4c8773 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -3885,6 +3885,62 @@ INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,E INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---Functions for AVR ---------------
+//------------------------------------
+
+
+//------------------------------------
+//---- Class AVRDigitalSetup ---------
+//------------------------------------
+ClassName = 'AVRDigitalSetup';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'AVRDigitalSetup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class AVRDigitalOut -----------
+//------------------------------------
+ClassName = 'AVRDigitalOut';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 3',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+PrintStringInfo('d0d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo('d0d0u80'+ArgSeparator+'u80',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'AVRDigitalOut';
+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/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin Binary files differindex 6220b291..f80837e1 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenAnnFLFunctions.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin Binary files differindex dc4c3fe9..db8c34ba 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.sci b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.sci index 743f6471..753509e3 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.sci +++ b/2.3-1/macros/ToolInitialization/INIT_GenFileInfo.sci @@ -108,4 +108,10 @@ FileInfo.GeneralReport = fullfile(FileInfo.WorkingDir,'SCI2CGeneralReport.txt'); FileInfo.CStyleSCI2CMainDir = pathconvert(FileInfo.SCI2CMainDir, %f, %f, 'u');
FileInfo.CStyleOutCCCodeDir = pathconvert(OutCCCodeDir, %f, %f, 'u');
FileInfo.MakefileFilename = fullfile(FileInfo.CStyleOutCCCodeDir,'Makefile');
+
+//-------------------------
+//----Hardware related-----
+//-------------------------
+FileInfo.PeripheralInitListFile = fullfile(FileInfo.WorkingDir,'PeripheralInit.dat');
+
endfunction
diff --git a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin Binary files differindex 2df9a4fd..f6059c98 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex ce14906c..42b16627 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin Binary files differindex 0a48d061..fbbb6414 100644 --- a/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin +++ b/2.3-1/macros/ToolInitialization/INIT_LoadLibraries.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin Binary files differindex fc036951..0740d242 100644 --- a/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_RemoveDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex 22ac0148..b0b849b8 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci index 4065d047..0340d6ff 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci @@ -144,6 +144,12 @@ SharedInfoDatFile = FileInfo.SharedInfoDatFile; global anscounter; //NUT: just to fix problem with ans variables.
anscounter = 0;
+//--------------------------------------------
+//---Hardware related initialisation----------
+//--------------------------------------------
+PeripheralList = list();
+save(FileInfo.PeripheralInitListFile, 'PeripheralList');
+
endfunction
// #RNU_RES_B
//NUT: quando genero il c della funzione utente devo anche generare il corrispondente file delle includes.
diff --git a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin Binary files differindex 55ef7bbc..5aeaa274 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SharedInfoEqual.bin diff --git a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin Binary files differindex 60555762..75360d7b 100644 --- a/2.3-1/macros/ToolInitialization/ManageNextConversion.bin +++ b/2.3-1/macros/ToolInitialization/ManageNextConversion.bin diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 4a06ba27..3acb88aa 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/ToolInitialization/lib b/2.3-1/macros/ToolInitialization/lib Binary files differindex 3db49c1c..6d909b02 100644 --- a/2.3-1/macros/ToolInitialization/lib +++ b/2.3-1/macros/ToolInitialization/lib diff --git a/2.3-1/macros/ToolInitialization/names b/2.3-1/macros/ToolInitialization/names index 0c264f0f..71a724d3 100644 --- a/2.3-1/macros/ToolInitialization/names +++ b/2.3-1/macros/ToolInitialization/names @@ -1 +1,14 @@ +INIT_CreateDirs INIT_FillSCI2LibCDirs +INIT_GenAnnFLFunctions +INIT_GenFileInfo +INIT_GenLibraries +INIT_GenSharedInfo +INIT_LoadLibraries +INIT_RemoveDirs +INIT_SCI2C +INIT_SharedInfoEqual +ManageNextConversion +UpdateSCI2CInfo +doublecomplex +floatcomplex diff --git a/2.3-1/macros/buildmacros.sce b/2.3-1/macros/buildmacros.sce index 41e3ace0..627e6384 100644 --- a/2.3-1/macros/buildmacros.sce +++ b/2.3-1/macros/buildmacros.sce @@ -8,7 +8,8 @@ Directories = [ "ASTManagement", ... "FunctionList", ... "GeneralFunctions", ... "SymbolTable", ... - "ToolInitialization" ]; + "ToolInitialization"... + "Hardware" ]; current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); diff --git a/2.3-1/macros/cb_sci2c_gui.bin b/2.3-1/macros/cb_sci2c_gui.bin Binary files differindex a1e97832..00bf3684 100644 --- a/2.3-1/macros/cb_sci2c_gui.bin +++ b/2.3-1/macros/cb_sci2c_gui.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex e9992fd4..6c4c15f7 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index e152514b..f5c74bd0 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -136,10 +136,17 @@ function allHeaders = getAllHeaders(OutFormat) "src/c/scilab-arduino/includes/cmd_analog_in.h" "src/c/scilab-arduino/includes/sleep.h"]; + AVR_headers = [ + "src/c/hardware/avr/includes/AVRPeripheralGPIO.h" + "src/c/hardware/avr/includes/AVRPeripheralADC.h" + ]; + if OutFormat == "StandAlone" allHeaders = Standalone_headers; elseif OutFormat == "Arduino" allHeaders = cat(1,Standalone_headers, Arduino_headers); + elseif OutFormat == "AVR" + allHeaders = cat(1,Standalone_headers, AVR_headers); end endfunction diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex c607ea19..ec75338c 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index b32bb652..5b52c71a 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -129,10 +129,18 @@ function allInterfaces = getAllInterfaces(OutFormat) "src/c/scilab-arduino/interfaces/int_cmd_analog_in.h" "src/c/scilab-arduino/interfaces/int_sleep.h"]; + //Interface files required for "AVR" output + AVR_interfaces = [ + "src/c/hardware/avr/interfaces/int_AVRPeripheralGPIO.h" + "src/c/hardware/avr/interfaces/int_AVRPeripheralADC.h" + ]; + if OutFormat == "StandAlone" allInterfaces = Standalone_interfaces; elseif OutFormat == "Arduino" allInterfaces = cat(1,Standalone_interfaces, Arduino_interfaces); + elseif OutFormat == "AVR" + allInterfaces = cat(1,Standalone_interfaces, AVR_interfaces); end endfunction diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex 1d698a0e..6c3f91f5 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 356ba38e..956f7be1 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -823,10 +823,24 @@ function allSources = getAllSources(OutFormat) "src/c/scilab-arduino/cmd_analog_out/u8cmd_analog_outs.c" "src/c/scilab-arduino/cmd_analog_in/u8cmd_analog_ins.c" "src/c/scilab-arduino/sleep/u16sleeps.c"]; + + //Files to be inserted only if output format selected is 'AVR'. + AVR_files = [ + "src/c/hardware/avr/gpio/u8AVRDigitalSetups.c" + "src/c/hardware/avr/gpio/u8AVRDigitalOuts.c" + "src/c/hardware/avr/gpio/u8AVRDigitalIns.c" + "src/c/hardware/avr/adc/u8AVRADCSetups.c" + "src/c/hardware/avr/adc/u8AVRReadADCs.c" + "src/c/scilab-arduino/sleep/u16sleeps.c" + ]; + + if OutFormat == "StandAlone" allSources = Standalone_files; elseif OutFormat == "Arduino" allSources = cat(1,Standalone_files, Arduino_files); + elseif OutFormat == "AVR" + allSources = cat(1,Standalone_files, AVR_files); end endfunction diff --git a/2.3-1/macros/findDeps/getArduinoFiles.bin b/2.3-1/macros/findDeps/getArduinoFiles.bin Binary files differindex 3becbac7..c762c303 100644 --- a/2.3-1/macros/findDeps/getArduinoFiles.bin +++ b/2.3-1/macros/findDeps/getArduinoFiles.bin diff --git a/2.3-1/macros/lib b/2.3-1/macros/lib Binary files differindex 419931c4..8fbf4888 100644 --- a/2.3-1/macros/lib +++ b/2.3-1/macros/lib diff --git a/2.3-1/macros/names b/2.3-1/macros/names index b7a78575..a126347e 100644 --- a/2.3-1/macros/names +++ b/2.3-1/macros/names @@ -1,6 +1,6 @@ cb_sci2c_gui getScilab2cVersion runsci2c +runscicode sci2c_gui scilab2c -runscicode diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex 2cc69e9e..053c3311 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index 880cc9d8..ac826a3a 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -105,7 +105,7 @@ mkdir(SCI2COutputPath+"/interfaces/"); PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
for i = 1:size(allSources, "*")
// DEBUG only
- //disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
+ disp("Copying "+allSources(i)+" in "+SCI2COutputPath+"/src/c/");
copyfile(allSources(i), SCI2COutputPath+"/src/c/");
end
@@ -113,7 +113,7 @@ end PrintStepInfo('Copying headers', FileInfo.GeneralReport,'both');
for i = 1:size(allHeaders, "*")
// DEBUG only
- // disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
+ disp("Copying "+allHeaders(i)+" in "+SCI2COutputPath+"/includes/");
copyfile(allHeaders(i), SCI2COutputPath+"/includes/");
end
@@ -121,7 +121,7 @@ end PrintStepInfo('Copying interfaces', FileInfo.GeneralReport,'both');
for i = 1:size(allInterfaces, "*")
// DEBUG only
- //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
end
diff --git a/2.3-1/macros/sci2c_gui.bin b/2.3-1/macros/sci2c_gui.bin Binary files differindex 1c1b69c9..9bdf607c 100644 --- a/2.3-1/macros/sci2c_gui.bin +++ b/2.3-1/macros/sci2c_gui.bin diff --git a/2.3-1/macros/scilab2c.bin b/2.3-1/macros/scilab2c.bin Binary files differindex 7416eb5f..e9fb5faa 100644 --- a/2.3-1/macros/scilab2c.bin +++ b/2.3-1/macros/scilab2c.bin diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index 1d4675e3..64d5753f 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -143,9 +143,9 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), // --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! --- - if OutFormat == "StandAlone" - runscicode(UserScilabMainFile, UserSciFilesPaths); - end +// if OutFormat == "StandAlone" +// runscicode(UserScilabMainFile, UserSciFilesPaths); +// end // --- ASK USER FOR CONTINUATION. --- // Do not open confirmation box if we are not in STD mode. @@ -156,7 +156,7 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), end if (userchoice == 1) // --- LAUNCH SCI2C --- - runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,OutFormat); + runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,'AVR'); end endfunction |