-
Notifications
You must be signed in to change notification settings - Fork 151
Adds dshot reverse commands support #157
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
Draft
Alissonsz
wants to merge
3
commits into
rtlopez:master
Choose a base branch
from
Alissonsz:dshot-reverse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #pragma once | ||
|
|
||
| #include "Arduino.h" | ||
| #include "EscDriver.h" | ||
|
|
||
| // The official DShot Commands | ||
| enum DshotCommand | ||
| { | ||
| DSHOT_CMD_MOTOR_STOP = 0, // Currently not implemented - STOP Motors | ||
| DSHOT_CMD_BEEP1, // Wait at least length of beep (380ms) before next command | ||
| DSHOT_CMD_BEEP2, // Wait at least length of beep (380ms) before next command | ||
| DSHOT_CMD_BEEP3, // Wait at least length of beep (400ms) before next command | ||
| DSHOT_CMD_BEEP4, // Wait at least length of beep (400ms) before next command | ||
| DSHOT_CMD_BEEP5, // Wait at least length of beep (400ms) before next command | ||
| DSHOT_CMD_ESC_INFO, // Currently not implemented | ||
| DSHOT_CMD_SPIN_DIRECTION_1, // Need 6x, no wait required | ||
| DSHOT_CMD_SPIN_DIRECTION_2, // Need 6x, no wait required | ||
| DSHOT_CMD_3D_MODE_OFF, // Need 6x, no wait required | ||
| DSHOT_CMD_3D_MODE_ON, // Need 6x, no wait required | ||
| DSHOT_CMD_SETTINGS_REQUEST, // Currently not implemented | ||
| DSHOT_CMD_SAVE_SETTINGS, // Need 6x, wait at least 12ms before next command | ||
| DSHOT_CMD_SPIN_DIRECTION_NORMAL = 20, // Need 6x, no wait required | ||
| DSHOT_CMD_SPIN_DIRECTION_REVERSED = 21, // Need 6x, no wait required | ||
| DSHOT_CMD_LED0_ON, // Currently not implemented | ||
| DSHOT_CMD_LED1_ON, // Currently not implemented | ||
| DSHOT_CMD_LED2_ON, // Currently not implemented | ||
| DSHOT_CMD_LED3_ON, // Currently not implemented | ||
| DSHOT_CMD_LED0_OFF, // Currently not implemented | ||
| DSHOT_CMD_LED1_OFF, // Currently not implemented | ||
| DSHOT_CMD_LED2_OFF, // Currently not implemented | ||
| DSHOT_CMD_LED3_OFF, // Currently not implemented | ||
| DSHOT_CMD_36, // Not yet assigned | ||
| DSHOT_CMD_37, // Not yet assigned | ||
| DSHOT_CMD_38, // Not yet assigned | ||
| DSHOT_CMD_39, // Not yet assigned | ||
| DSHOT_CMD_40, // Not yet assigned | ||
| DSHOT_CMD_41, // Not yet assigned | ||
| DSHOT_CMD_SIGNAL_LINE_TEMPERATURE_TELEMETRY, // No wait required | ||
| DSHOT_CMD_SIGNAL_LINE_VOLTAGE_TELEMETRY, // No wait required | ||
| DSHOT_CMD_SIGNAL_LINE_CURRENT_TELEMETRY, // No wait required | ||
| DSHOT_CMD_SIGNAL_LINE_CONSUMPTION_TELEMETRY, // No wait required | ||
| DSHOT_CMD_SIGNAL_LINE_ERPM_TELEMETRY, // No wait required | ||
| DSHOT_CMD_SIGNAL_LINE_ERPM_PERIOD_TELEMETRY, // No wait required (also command 47) | ||
| DSHOT_CMD_MAX = 47 | ||
| }; |
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
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
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtlopez How would you call this function from the CLI? I tried some ways but everything felt too ugly 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_model.state.mixer.escMotor->reverseMotor(), but check first if pointer is initialized.