mirror of
https://github.com/bdring/Grbl_Esp32.git
synced 2025-09-02 02:42:36 +02:00
Fixing brackets
This commit is contained in:
@@ -367,10 +367,10 @@ void motors_read_settings() {
|
|||||||
// They can use this to setup things like Stall
|
// They can use this to setup things like Stall
|
||||||
void motors_set_homing_mode(uint8_t homing_mask, bool isHoming) {
|
void motors_set_homing_mode(uint8_t homing_mask, bool isHoming) {
|
||||||
for (uint8_t gang_index = 0; gang_index < 2; gang_index++) {
|
for (uint8_t gang_index = 0; gang_index < 2; gang_index++) {
|
||||||
for (uint8_t axis = X_AXIS; axis < N_AXIS; axis++)
|
for (uint8_t axis = X_AXIS; axis < N_AXIS; axis++) {
|
||||||
if (bit_istrue(homing_mask, bit(axis)) && (myMotor[axis][gang_index]->is_active))
|
if (bit_istrue(homing_mask, bit(axis)) && (myMotor[axis][gang_index]->is_active)) {
|
||||||
myMotor[axis][gang_index]->set_homing_mode(homing_mask, isHoming);
|
myMotor[axis][gang_index]->set_homing_mode(homing_mask, isHoming);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -159,8 +159,9 @@ namespace Motors {
|
|||||||
float hold (as a percentage of run)
|
float hold (as a percentage of run)
|
||||||
*/
|
*/
|
||||||
void TrinamicDriver::read_settings() {
|
void TrinamicDriver::read_settings() {
|
||||||
if (has_errors) {
|
if (has_errors)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint16_t run_i_ma = (uint16_t)(axis_settings[_axis_index]->run_current->get() * 1000.0);
|
uint16_t run_i_ma = (uint16_t)(axis_settings[_axis_index]->run_current->get() * 1000.0);
|
||||||
float hold_i_percent;
|
float hold_i_percent;
|
||||||
|
|
||||||
@@ -170,7 +171,6 @@ namespace Motors {
|
|||||||
hold_i_percent = axis_settings[_axis_index]->hold_current->get() / axis_settings[_axis_index]->run_current->get();
|
hold_i_percent = axis_settings[_axis_index]->hold_current->get() / axis_settings[_axis_index]->run_current->get();
|
||||||
if (hold_i_percent > 1.0)
|
if (hold_i_percent > 1.0)
|
||||||
hold_i_percent = 1.0;
|
hold_i_percent = 1.0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Current run %d hold %f", _axis_name, run_i_ma, hold_i_percent);
|
//grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "%s Current run %d hold %f", _axis_name, run_i_ma, hold_i_percent);
|
||||||
|
|
||||||
|
@@ -56,30 +56,25 @@ namespace Motors {
|
|||||||
|
|
||||||
if (!(step_mask & bit(_axis_index)))
|
if (!(step_mask & bit(_axis_index)))
|
||||||
return; // a step is not required on this interrupt
|
return; // a step is not required on this interrupt
|
||||||
}
|
|
||||||
|
|
||||||
if (!_enabled) {
|
if (!_enabled)
|
||||||
return; // don't do anything, phase is not changed or lost
|
return; // don't do anything, phase is not changed or lost
|
||||||
}
|
|
||||||
|
|
||||||
if (_half_step) {
|
if (_half_step)
|
||||||
phase_max = 7;
|
phase_max = 7;
|
||||||
} else {
|
else
|
||||||
phase_max = 3;
|
phase_max = 3;
|
||||||
}
|
|
||||||
|
|
||||||
if (dir_mask & bit(_axis_index)) { // count up
|
if (dir_mask & bit(_axis_index)) { // count up
|
||||||
if (_current_phase == phase_max)
|
if (_current_phase == phase_max)
|
||||||
_current_phase = 0;
|
_current_phase = 0;
|
||||||
} else {
|
else
|
||||||
_current_phase++;
|
_current_phase++;
|
||||||
}
|
|
||||||
} else { // count down
|
} else { // count down
|
||||||
if (_current_phase == 0) {
|
if (_current_phase == 0)
|
||||||
_current_phase = phase_max;
|
_current_phase = phase_max;
|
||||||
} else {
|
else
|
||||||
_current_phase--;
|
_current_phase--;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
8 Step : A – AB – B – BC – C – CD – D – DA
|
8 Step : A – AB – B – BC – C – CD – D – DA
|
||||||
|
Reference in New Issue
Block a user