[quote:f8a412392f]Uh, that would be quite a foul.[/quote:f8a412392f]
Yes, I figured thered be stack issues if I just used a Goto to jump back to a base subroutine. But was worth asking for advice. Definitely seems best to unwind the subroutine calls properly and check for any error flags as you go. Keeps things clean and avoids unexpected behavior.
[quote:f8a412392f]Is your code's error handling that urgent, that you think about such methods?[/quote:f8a412392f]
My code is running stepper motors, and part of the process includes ray casting calculations to determine whether a point is inside or outside a polygon. Theres also UART data and other tasks that need attention once the ray casting is done. Rather than trying to jump around in the subs, I just set flags during the calculations and handle housekeeping tasks afterward in a controlled manner. Keeps the flow manageable and avoids potential stack or state issues.
↧