Hey guys, I'm coding a piece of software for my home made cockpit.
What I would like to know is what is the proper or more efficient way to detect when a variable changes its value.
This is an example about how I do it right now:
Even when it works, there is a ton of variables I must check on every cycle, I thing there must be a better way to handle this, right?
What I would like to know is what is the proper or more efficient way to detect when a variable changes its value.
This is an example about how I do it right now:
Code:
void processData(Data *pS)
{
if(pS->myVar) // boolean
{
// do something
}else{
// do something
}
}
Even when it works, there is a ton of variables I must check on every cycle, I thing there must be a better way to handle this, right?



