Beta - Board wont crash if limit switch for steppers is configured#276
Merged
DocMoebiuz merged 3 commits intoMobiFlight:mainfrom Nov 12, 2023
Merged
Conversation
|
Firmware for this pull request: |
DocMoebiuz
approved these changes
Nov 12, 2023
| params[7] = false; // deactivate output | ||
|
|
||
| if (command == kTypeStepperDeprecated2) { | ||
| if (command == kTypeStepperDeprecated2 || command == kTypeStepper) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
With the code changes done with PR #261 the structure for reading the stepper config was bundled and slightly changed.
While the config gets read from the eeprom, the parameter are assigned to an array and this array is used for the parameters of the
Stepper::Add(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7]);function.For the actual stepper type the button gets not read which is now added with this PR. Furthermore sending commands to an not initialized stepper will be blocked
If the button gets not read, the next read command, which is reading the stepper mode, reads the button number. So the button number is treated as stepper mode. Within the stepper code it's checked if it's a valid mode. If not, and that's for all button numbers bigger then 2, creating a new stepper class is aborted. This is saved but not considered when commands are issued.
Fixes #275