mirror of
https://github.com/esphome/esphome.git
synced 2025-01-07 05:11:43 +01:00
Handle clang feedback.
This commit is contained in:
parent
6f91a36275
commit
d8dd3148eb
1 changed files with 2 additions and 1 deletions
|
@ -38,7 +38,8 @@ int32_t Stepper::should_step_() {
|
|||
// assumes this method is called in a constant interval
|
||||
uint32_t dt = now - this->last_step_;
|
||||
if (dt >= (1 / this->current_speed_) * 1e6f) {
|
||||
int32_t mag = (rotation_ == ROTATION_BOTH ? (this->target_position > this->current_position ? 1 : -1) : (rotation_ == ROTATION_CW ? 1 : -1));
|
||||
int32_t mag = (rotation_ == ROTATION_BOTH ? (this->target_position > this->current_position ? 1 : -1)
|
||||
: (rotation_ == ROTATION_CW ? 1 : -1));
|
||||
this->last_step_ = now;
|
||||
this->current_position += mag;
|
||||
return mag;
|
||||
|
|
Loading…
Reference in a new issue