From db464f35f5a10b58d9ed1085e0b462689adee583 Mon Sep 17 00:00:00 2001 From: Siddhesh Wani Date: Mon, 25 May 2015 14:46:31 +0530 Subject: Original Version --- macros/CCodeGeneration/C_GenerateFunName.sci | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 macros/CCodeGeneration/C_GenerateFunName.sci (limited to 'macros/CCodeGeneration/C_GenerateFunName.sci') diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci new file mode 100644 index 00000000..9d40d2b9 --- /dev/null +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -0,0 +1,44 @@ +function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) +// function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) +// ----------------------------------------------------------------- +// //NUT: add description here +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 26-Oct-2007 -- Raffaele Nutricato: Author. +// 26-Oct-2007 -- Alberto Morea: Test Ok. +// 11-Nov-2007 -- Raffaele Nutricato: changed naming rule. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ +SCI2CNInArgCheck(argn(2),5,5); +CFunName = ''; + +for tmpcnt = 1:NInArg + if (InArg(tmpcnt).Dimension == 1) + CFunName = CFunName+InArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); + end +end + +CFunName = CFunName+FunctionName; + +for tmpcnt = 1:NOutArg + if (OutArg(tmpcnt).Dimension == 1) + CFunName = CFunName+OutArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); + end +end +endfunction -- cgit From 7cba1cf7d2ee89559239a22c50297a1545de0587 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 13 Jan 2016 11:15:17 +0530 Subject: Test commit --- macros/CCodeGeneration/C_GenerateFunName.sci | 36 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'macros/CCodeGeneration/C_GenerateFunName.sci') diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index 9d40d2b9..657258a9 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,22 +23,30 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; +if(IsAVRSupportFunction(FunctionName)) +//If current function is an AVR function, then function name can be just plain +//function name without any input/output arguments types -for tmpcnt = 1:NInArg - if (InArg(tmpcnt).Dimension == 1) - CFunName = CFunName+InArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); - end -end + CFunName = CFunName+FunctionName; + +else + + for tmpcnt = 1:NInArg + if (InArg(tmpcnt).Dimension == 1) + CFunName = CFunName+InArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+InArg(tmpcnt).Type+SCI2Cstring(InArg(tmpcnt).Dimension); + end + end -CFunName = CFunName+FunctionName; + CFunName = CFunName+FunctionName; -for tmpcnt = 1:NOutArg - if (OutArg(tmpcnt).Dimension == 1) - CFunName = CFunName+OutArg(tmpcnt).Type+'2'; - else - CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); - end + for tmpcnt = 1:NOutArg + if (OutArg(tmpcnt).Dimension == 1) + CFunName = CFunName+OutArg(tmpcnt).Type+'2'; + else + CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); + end + end end endfunction -- cgit From 5df6d1cb2868abdc8df66755f76c997ee36c0b49 Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Mon, 1 Feb 2016 11:05:35 +0530 Subject: Support for RPi gpios added --- macros/CCodeGeneration/C_GenerateFunName.sci | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'macros/CCodeGeneration/C_GenerateFunName.sci') diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index 657258a9..54c641f2 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,9 +23,9 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; -if(IsAVRSupportFunction(FunctionName)) -//If current function is an AVR function, then function name can be just plain -//function name without any input/output arguments types +if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName))) +//If current function is an AVR or RPi function, then function name can be just +//plain function name without any input/output arguments types CFunName = CFunName+FunctionName; -- cgit From 212c54043e454e41ca4b23a5b965d4dbd4b683fe Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Fri, 27 May 2016 11:50:04 +0530 Subject: Support for basic ODE function added --- macros/CCodeGeneration/C_GenerateFunName.sci | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'macros/CCodeGeneration/C_GenerateFunName.sci') diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index 54c641f2..d87fb9c1 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,14 +23,14 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; -if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName))) +if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName)) | ... + (mtlb_strcmp(part(FunctionName,1:5),'odefn') == %T)) //If current function is an AVR or RPi function, then function name can be just //plain function name without any input/output arguments types CFunName = CFunName+FunctionName; else - for tmpcnt = 1:NInArg if (InArg(tmpcnt).Dimension == 1) CFunName = CFunName+InArg(tmpcnt).Type+'2'; @@ -48,5 +48,6 @@ else CFunName = CFunName+OutArg(tmpcnt).Type+SCI2Cstring(OutArg(tmpcnt).Dimension); end end + end endfunction -- cgit From 24fbba33153e7758df4a990cb4c21ae8e53e6f3e Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Mon, 25 Jul 2016 15:59:40 +0530 Subject: WiringPi used for RaspberryPi (Gpio, serial, Threads, ISRs) --- macros/CCodeGeneration/C_GenerateFunName.sci | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'macros/CCodeGeneration/C_GenerateFunName.sci') diff --git a/macros/CCodeGeneration/C_GenerateFunName.sci b/macros/CCodeGeneration/C_GenerateFunName.sci index d87fb9c1..a1373ded 100644 --- a/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/macros/CCodeGeneration/C_GenerateFunName.sci @@ -24,10 +24,13 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName)) | ... - (mtlb_strcmp(part(FunctionName,1:5),'odefn') == %T)) + (mtlb_strcmp(part(FunctionName,1:5),'odefn') == %T) |... + (mtlb_strcmp(part(FunctionName,1:9),'PI_thread') == %T)| ... + (mtlb_strcmp(part(FunctionName,1:4),'ISR_') == %T)) //If current function is an AVR or RPi function, then function name can be just //plain function name without any input/output arguments types - +//Slimilarly for functions conataining ode functions and functions to be called in +//separate thread in RPi CFunName = CFunName+FunctionName; else -- cgit