mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-22 08:04:07 +08:00
Merge branch 'devel' of https://github.com/madcowswe/ODrive into counts_to_rads
Merge devel into counts_to_rads (turns) - conflict for the step input callback
This commit is contained in:
@@ -118,12 +118,10 @@ bool Axis::wait_for_current_meas() {
|
||||
|
||||
// step/direction interface
|
||||
void Axis::step_cb() {
|
||||
if (step_dir_active_) {
|
||||
GPIO_PinState dir_pin = HAL_GPIO_ReadPin(dir_port_, dir_pin_);
|
||||
float dir = (dir_pin == GPIO_PIN_SET) ? 1.0f : -1.0f;
|
||||
controller_.input_pos_ += dir * config_.turns_per_step;
|
||||
controller_.input_pos_updated();
|
||||
}
|
||||
const bool dir_pin = dir_port_->IDR & dir_pin_;
|
||||
const int32_t dir = (-1 + 2 * dir_pin) * step_dir_active_;
|
||||
controller_.input_pos_ += dir * config_.counts_per_step;
|
||||
controller_.input_pos_updated();
|
||||
};
|
||||
|
||||
void Axis::load_default_step_dir_pin_config(
|
||||
|
||||
Reference in New Issue
Block a user