Home > other >  Function quit, again into the need to preserve local variables and operation
Function quit, again into the need to preserve local variables and operation

Time:10-03

I use ST microcontroller programming, to achieve such a function: enter a function to run, run to somewhere (the end), returns, when again after entering the function, able to run then the location of the exit, and the local variables and the operation is still valid,
Days to open a bit intention, and do not know to have what idea, thank you!

CodePudding user response:

Run OS

CodePudding user response:

reference 1st floor dceacho response:
run OS
I just write a simple OS, other already finished, just this??

CodePudding user response:

Finish is to take steps to perform this function, define a variable Step, said should perform the Step

CodePudding user response:

reference schlafenhamster reply: 3/f
is a few steps performed this function points, and define a variable Step, said Step should perform the
say I three, the first Step I is 1, then exits function, the second time to come in, but the second Step, perform i++, at this time I was not based on the increase of 1

CodePudding user response:

This function is to perform a sequence control? Personal opinion is generally use freertos create multiple tasks, set a global variable tag to which step to perform this task

CodePudding user response:

Step variable
In the function declaration
Static int Step=0;

CodePudding user response:

Static heart enough, adding the static

CodePudding user response:

What you mean? Isn't this an interrupt is solved
  • Related