Page 1 of 1

Running light in FC8 gives error recursive function call

Posted: Thu Oct 28, 2021 1:50 pm
by theopieleke
Hello,

I'm having trouble finding out what's wrong with this program.
In simulation (FC8) it works fine, but when we try to convert it to a hex-file we get this message:

running_light_recursive_problem.c: 1642: (1089) recursive function call to "_FCM_rechts_links"
running_light_recursive_problem.c: 1708: (1089) recursive function call to "_FCM_links_rechts"
(908) exit status = 1
(908) exit status = 1
Error returned from [xc8.exe]
C:\Program Files (x86)\Flowcode\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1
Autoclose turned off
FINISHED

Greetings,
Theo

Re: Running light in FC8 gives error recursive function call

Posted: Thu Oct 28, 2021 2:31 pm
by Steve
This error shows your program could fail because those two functions could call each other and you could cause an internal overflow. In fact you can simulate this by changing your switches to "latching" and then setting them both on. Your program will eventually crash even in simulation because the call stack overflows.

You will need to change how your program operates so that this recursion cannot happen.