|
Re: Call to PIDController::GetError() and ::OnTarget() locks program.
Replace your GetError function with this. It should work.
/**
* Retruns the current difference of the input from the setpoint
* @return the current error
*/
float PIDController::GetError() {
float error;
PIDSource *pidInput;
CRITICAL_REGION(m_semaphore)
{
pidInput = m_pidInput;
error = GetSetpoint() - pidInput->PIDGet();
}END_REGION;
return error;
}
|