mirror of
https://github.com/grblHAL/core.git
synced 2026-02-06 00:52:35 +08:00
clear homed status for axis that has max travel changed
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef I2C_ENABLE
|
||||
#if EEPROM_ENABLE || KEYPAD_ENABLE == 1 || (TRINAMIC_ENABLE && TRINAMIC_I2C)
|
||||
#if EEPROM_ENABLE || KEYPAD_ENABLE == 1 || I2C_STROBE_ENABLE || (TRINAMIC_ENABLE && TRINAMIC_I2C)
|
||||
#define I2C_ENABLE 1
|
||||
#else
|
||||
#define I2C_ENABLE 0
|
||||
|
||||
@@ -697,7 +697,7 @@ static void motor_iterator (motor_iterator_callback_ptr callback)
|
||||
{
|
||||
motor_map_t motor;
|
||||
|
||||
for(motor.id = 0; motor.id < N_AXIS + N_GANGED; motor.id++)
|
||||
if(callback) for(motor.id = 0; motor.id < N_AXIS + N_GANGED; motor.id++)
|
||||
{
|
||||
if(motor.id < N_AXIS)
|
||||
motor.axis = motor.id;
|
||||
|
||||
@@ -1079,6 +1079,7 @@ static status_code_t set_axis_setting (setting_id_t setting, float value)
|
||||
if(settings.axis[idx].steps_per_mm > 0.0f && settings.axis[idx].steps_per_mm != value) {
|
||||
float comp = value / settings.axis[idx].steps_per_mm;
|
||||
sys.position[idx] *= comp;
|
||||
sys.home_position[idx] *= comp;
|
||||
sys.probe_position[idx] *= comp;
|
||||
sys.tlo_reference[idx] *= comp;
|
||||
sync_position();
|
||||
@@ -1099,6 +1100,8 @@ static status_code_t set_axis_setting (setting_id_t setting, float value)
|
||||
break;
|
||||
|
||||
case Setting_AxisMaxTravel:
|
||||
if((sys.report.homed = settings.axis[idx].max_travel != -value))
|
||||
bit_false(sys.homed.mask, bit(idx));
|
||||
settings.axis[idx].max_travel = -value; // Store as negative for grbl internal use.
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user