Calling task inside a function

In reply to jaswanth_b:

10-10 is the right result, this is a different story since the functions/tasks have static lifetime in module so there is no stack call. Hence they share the same memory 15 and then assigned to 10 that means only 10 printed 2.

declare them as automatic and you will see 15 coming.

Regards

1 Like