1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 18:32:37 +02:00

Fixing brackets

This commit is contained in:
bdring
2020-09-08 21:22:32 -05:00
parent 94b6feecce
commit 42eab9d6e6
3 changed files with 11 additions and 16 deletions

View File

@@ -367,10 +367,10 @@ void motors_read_settings() {
// They can use this to setup things like Stall
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 axis = X_AXIS; axis < N_AXIS; axis++)
if (bit_istrue(homing_mask, bit(axis)) && (myMotor[axis][gang_index]->is_active))
for (uint8_t axis = X_AXIS; axis < N_AXIS; axis++) {
if (bit_istrue(homing_mask, bit(axis)) && (myMotor[axis][gang_index]->is_active)) {
myMotor[axis][gang_index]->set_homing_mode(homing_mask, isHoming);
}
}
}
}
}

View File

@@ -159,8 +159,9 @@ namespace Motors {
float hold (as a percentage of run)
*/
void TrinamicDriver::read_settings() {
if (has_errors) {
if (has_errors)
return;
uint16_t run_i_ma = (uint16_t)(axis_settings[_axis_index]->run_current->get() * 1000.0);
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();
if (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);

View File

@@ -56,30 +56,25 @@ namespace Motors {
if (!(step_mask & bit(_axis_index)))
return; // a step is not required on this interrupt
}
if (!_enabled) {
if (!_enabled)
return; // don't do anything, phase is not changed or lost
}
if (_half_step) {
if (_half_step)
phase_max = 7;
} else {
else
phase_max = 3;
}
if (dir_mask & bit(_axis_index)) { // count up
if (_current_phase == phase_max)
_current_phase = 0;
} else {
else
_current_phase++;
}
} else { // count down
if (_current_phase == 0) {
if (_current_phase == 0)
_current_phase = phase_max;
} else {
else
_current_phase--;
}
}
/*
8 Step : A AB B BC C CD D DA