Im new to dual core programming and i do not know the best practices yet. In my current project, i would like the second core to only do something after it is being told by the first core.
The approach i am using somewhat of a brute force is something like this:
bool indicator = false;
int a,b;
void loop () { // core1
if(indicator == false){ //check if core2 is still processing
a=random(100);
b=random(100);
indicator = true;
}
}
void loop1(){ //core2
if(indicator == true){
int sum = a+b;
Serial.println(sum);
indicator == false;
}
}
this is just a simplified idea of how my code is going to be. Are there better ways of going about this? In general i want to tell core2 from core1 that it needs to start/stop doing something.