- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a recursive function in my code I want to configure the depth of recursive to 20 how can I do the same.
Sunny
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Sunny ,
Can you please share the details of your compiler and IDE version which you are using.
We have provided an example to configure depth of recursive function in compiler:
Compiler: arm-none-eabi-gcc
IDE : Moduls tool box 2.3
Please open Makefile in your project directory and modify these values.
CONFIG=Custom
CXXFLAGS= --param ipa-cp-max-recursive-depth = 20
Please refer to below link for more compiler options:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Configuring depth of recursive function without compiler option:
You can increment a variable for each recursive call to determine the depth and can exit the recursion once it reaches depth of recursive call.
Example:
int recursive(int i)
{
if(i==0 || count ==20)
return i;
count++;
recursive(i-1);
}
Thanks,
Krupashankar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Sunny ,
Can you please share the details of your compiler and IDE version which you are using.
We have provided an example to configure depth of recursive function in compiler:
Compiler: arm-none-eabi-gcc
IDE : Moduls tool box 2.3
Please open Makefile in your project directory and modify these values.
CONFIG=Custom
CXXFLAGS= --param ipa-cp-max-recursive-depth = 20
Please refer to below link for more compiler options:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Configuring depth of recursive function without compiler option:
You can increment a variable for each recursive call to determine the depth and can exit the recursion once it reaches depth of recursive call.
Example:
int recursive(int i)
{
if(i==0 || count ==20)
return i;
count++;
recursive(i-1);
}
Thanks,
Krupashankar