diff --git a/CHANGELOG.md b/CHANGELOG.md index 71edf5d8..742c5300 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ Please add a note of your changes below this heading if you make a Pull Request. ## Fixed * Would ERROR_CONTROL_DEADLINE_MISSED along with every ERROR_PHASE_RESISTANCE_OUT_OF_RANGE. +### Changed +* renamed `axis.enable_step_dir` to `axis.step_dir_active` + # Releases ## [0.4.6] - 2018-10-07 ### Fixed diff --git a/Firmware/MotorControl/axis.cpp b/Firmware/MotorControl/axis.cpp index 01892af1..0ab726ff 100644 --- a/Firmware/MotorControl/axis.cpp +++ b/Firmware/MotorControl/axis.cpp @@ -66,7 +66,7 @@ bool Axis::wait_for_current_meas() { // step/direction interface void Axis::step_cb() { - if (enable_step_dir_) { + if (step_dir_active_) { GPIO_PinState dir_pin = HAL_GPIO_ReadPin(hw_config_.dir_port, hw_config_.dir_pin); float dir = (dir_pin == GPIO_PIN_SET) ? 1.0f : -1.0f; controller_.pos_setpoint_ += dir * config_.counts_per_step; @@ -87,9 +87,9 @@ void Axis::set_step_dir_enabled(bool enable) { GPIO_subscribe(hw_config_.step_port, hw_config_.step_pin, GPIO_PULLDOWN, step_cb_wrapper, this); - enable_step_dir_ = true; + step_dir_active_ = true; } else { - enable_step_dir_ = false; + step_dir_active_ = false; // Unsubscribe from step GPIO GPIO_unsubscribe(hw_config_.step_port, hw_config_.step_pin); diff --git a/Firmware/MotorControl/axis.hpp b/Firmware/MotorControl/axis.hpp index 9e3de43c..6e9b8bfc 100644 --- a/Firmware/MotorControl/axis.hpp +++ b/Firmware/MotorControl/axis.hpp @@ -167,7 +167,7 @@ public: // variables exposed on protocol Error_t error_ = ERROR_NONE; - bool enable_step_dir_ = false; // auto enabled after calibration, based on config.enable_step_dir + bool step_dir_active_ = false; // auto enabled after calibration, based on config.enable_step_dir State_t requested_state_ = AXIS_STATE_STARTUP_SEQUENCE; State_t task_chain_[10] = { AXIS_STATE_UNDEFINED }; State_t& current_state_ = task_chain_[0]; @@ -177,7 +177,7 @@ public: auto make_protocol_definitions() { return make_protocol_member_list( make_protocol_property("error", &error_), - make_protocol_property("enable_step_dir", &enable_step_dir_), + make_protocol_ro_property("step_dir_active", &step_dir_active_), make_protocol_ro_property("current_state", ¤t_state_), make_protocol_property("requested_state", &requested_state_), make_protocol_ro_property("loop_counter", &loop_counter_),