Wheel calibration by TRIM on Arduino Robot

Hi! I am working on Arduino Robot. I came across the following way of Wheel calibration:

http://arduino.cc/en/Tutorial/RobotWheelCalibration

As per the schematic I see that the TRIM value goes to the microcontroller via AD3/ TRIM. However, I am unable to find that how this AD3/ TRIM value affects the Motor speed. I see only IN_A1, IN_A2, IN_B1, IN_B2 as inputs to Motor Driver DRV8833PWPR which has no connection to AD3/ TRIM. Also the wheel calibration code does not do anything to write the TRIM values to IN_A1, IN_A2, IN_B1, IN_B2 to change the Motor speed.

I am wondering how the change in TRIM value changes the Motor speed. Does anyone has any clue on this?

It’s done in software (ArduinoRobotMotorBoard.cpp):

void RobotMotorBoard::motorsWrite(int speedL, int speedR){
	/*Serial.print(speedL);
	Serial.print(" ");
	Serial.println(speedR);*/
	//motor adjustment, using percentage
	_refreshMotorAdjustment();
	
	if(motorAdjustment<0){
		speedR*=(1+motorAdjustment);
	}else{
		speedL*=(1-motorAdjustment);
	}
	
	if(speedL>0){
		analogWrite(IN_A1,speedL);
		analogWrite(IN_A2,0);
	}else{
		analogWrite(IN_A1,0);
		analogWrite(IN_A2,-speedL);
	}
	
	if(speedR>0){
		analogWrite(IN_B1,speedR);
		analogWrite(IN_B2,0);
	}else{
		analogWrite(IN_B1,0);
		analogWrite(IN_B2,-speedR);
	}
}

void RobotMotorBoard::_refreshMotorAdjustment(){
	motorAdjustment=map(analogRead(TRIM),0,1023,-30,30)/100.0;
}

Thanks for pointing that :). I was missing that "_refreshMotorAdjustment()" is called on every MotorsWrite. Now it is all clear XD