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

stepper updates #67

Merged
merged 3 commits into from
Aug 3, 2013
Merged

Conversation

soundanalogous
Copy link
Member

Changes:

  • Sends correct value when step sequence is complete.
  • Set stepper array element to NULL after memory is freed (see inline comment).

for (byte i=0;i<MAX_STEPPERS;i++) {
if (stepper[i]) {
free(stepper[i]);
stepper[i] = NULL;
Copy link
Member Author

Choose a reason for hiding this comment

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

This was necessary or you would have to hard reset the arduino even after a soft reset. I'm assuming the issue is that the conditional on line 86 of StepperFirmata.cpp was not falsy for freed array elements (that or free(stepper[i] is not actually freeing the element).

@ntruchsess any thoughts on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

going to change this to stepper[i] = 0. Accomplishes same thing but avoids need to use NULL keyword.

soundanalogous added a commit that referenced this pull request Aug 3, 2013
@soundanalogous soundanalogous merged commit fe9b22c into firmata:configurable Aug 3, 2013
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.

1 participant