feat: harden seat intent and expand HIL coverage

This commit is contained in:
vee
2026-08-02 05:20:38 +08:00
parent 4aded5c21d
commit 55d0d400cb
62 changed files with 53112 additions and 1748 deletions
@@ -915,14 +915,22 @@ bool SeatMotor_CalibrateRange(motor_mode_t mode,
uint32_t commandSequence)
{
motor_calibration_result_t result;
uint8_t dutyPercent;
if((false == SeatMotor_ModeValid(mode)) || (0ul == legTimeoutMs))
{
return false;
}
/* The connected four-axis bench needs the same verified loaded duty used
* by normal absolute moves and known-range homing. The protocol minimum
* (50%) cannot reliably start M0/M1 at a loaded endpoint; using it makes
* the first quiet window look like an endpoint and invalidates an
* otherwise healthy calibration. Hall endpoint, timeout and current
* protections remain active throughout both legs. */
dutyPercent = SeatMotor_DefaultDutyPercent(mode);
if((false == SeatMotor_PrepareNewTask(mode, commandSequence)) ||
(MOTOR_API_SUCCESS != Motor_SetFixedDutyPercent(
mode, MOTOR_SPEED_MIN_DUTY_PERCENT)))
mode, dutyPercent)))
{
SeatMotor_SetFailed(mode, SEAT_MOTOR_RESULT_CALIBRATION_FAILED);
return false;