Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix : function name for acceleration and deceleration getters #39

Merged
merged 8 commits into from
Jan 16, 2024

Conversation

ameisso
Copy link
Contributor

@ameisso ameisso commented Jan 14, 2024

No description provided.

Copy link
Owner

@pkerspe pkerspe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo in word "deceleration". Then It should be good to merge

return acceleration_InStepsPerSecondPerSecond / stepsPerMillimeter;
}

float ESP_FlexyStepper::getConfiguredDescelerationInStepsPerSecondPerSecond()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo, should be "deceleration"

return deceleration_InStepsPerSecondPerSecond;
}

float ESP_FlexyStepper::getConfiguredDescelerationInRevolutionsPerSecondPerSecond()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo, should be "deceleration"

return deceleration_InStepsPerSecondPerSecond / stepsPerRevolution;
}

float ESP_FlexyStepper::getConfiguredDescelerationInMillimetersPerSecondPerSecond()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo, should be "deceleration"

float getConfiguredAccelerationInRevolutionsPerSecondPerSecond();
float getConfiguredAccelerationInMillimetersPerSecondPerSecond();

float getConfiguredDescelerationInStepsPerSecondPerSecond();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix typo, should be "deceleration"

@ameisso ameisso requested a review from pkerspe January 14, 2024 19:08
@ameisso
Copy link
Contributor Author

ameisso commented Jan 14, 2024

Hello,

Thanks for the review
Changes have been made

@pkerspe
Copy link
Owner

pkerspe commented Jan 14, 2024

Thanks @ameisso, the typos are fixed, but in commit 8239eb8 you additional changes to the code which are still not fixed according to comment. Also this additional change actually does not match the title of this pull request also. I don't mind so much about the title, but the logic should be changed according to comment to prevent dead code / empty code blocks.
Suggesting something like this:

if (coreNumber == 0)
  {
    disableCore0WDT(); // we have to disable the Watchdog timer to prevent it from rebooting the ESP all the time another option would be to add a vTaskDelay but it would slow down the stepper
}
#if ! (CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2)
  else if (coreNumber == 1)
  {
    disableCore1WDT(); // we have to disable the Watchdog timer to prevent it from rebooting the ESP all the time another option would be to add a vTaskDelay but it would slow down the stepper
  }
#endif
  else
  {
    // invalid core number given
    return false;
  }

Copy link
Owner

@pkerspe pkerspe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment about your newly added code block for wdt disabling

@@ -96,7 +96,9 @@ bool ESP_FlexyStepper::startAsService(int coreNumber)

if (coreNumber == 1)
{
#if ! (CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In such a case the whole if statement in the previous line would not make sense, since it would result in an empty block.
Please refactor so that we do not have an empty if block at all. Might need to simply exchange the if / else order.
At the end on such MCUs the function should return false if 1 is given as core number

@ameisso
Copy link
Contributor Author

ameisso commented Jan 15, 2024

Hello,

changed the block as you asked .
Thanks for the feedback

@ameisso ameisso requested a review from pkerspe January 15, 2024 13:14
@pkerspe pkerspe merged commit 80fa50c into pkerspe:master Jan 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants