Skip to content

Beta - Board wont crash if limit switch for steppers is configured#276

Merged
DocMoebiuz merged 3 commits intoMobiFlight:mainfrom
elral:read_stepperbutton_from_config
Nov 12, 2023
Merged

Beta - Board wont crash if limit switch for steppers is configured#276
DocMoebiuz merged 3 commits intoMobiFlight:mainfrom
elral:read_stepperbutton_from_config

Conversation

@elral
Copy link
Collaborator

@elral elral commented Nov 12, 2023

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

@elral elral requested a review from DocMoebiuz as a code owner November 12, 2023 08:09
@elral elral self-assigned this Nov 12, 2023
@elral elral added the beta-bug label Nov 12, 2023
@github-actions
Copy link

Firmware for this pull request:
Firmware.zip

params[7] = false; // deactivate output

if (command == kTypeStepperDeprecated2) {
if (command == kTypeStepperDeprecated2 || command == kTypeStepper) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops!

@DocMoebiuz DocMoebiuz changed the title Read stepperbutton from config Beta - Board wont crash if limit switch for steppers is configured Nov 12, 2023
@DocMoebiuz DocMoebiuz merged commit e8d8656 into MobiFlight:main Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Beta - Board crashes if limit switch for steppers is configured

2 participants