rename axis.enable_step_dir to axis.step_dir_active

This commit is contained in:
Oskar Weigl
2018-10-20 18:24:25 -07:00
parent c702e2f7e5
commit 3cb9a8d584
3 changed files with 8 additions and 5 deletions
+3
View File
@@ -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
+3 -3
View File
@@ -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);
+2 -2
View File
@@ -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", &current_state_),
make_protocol_property("requested_state", &requested_state_),
make_protocol_ro_property("loop_counter", &loop_counter_),