-
Notifications
You must be signed in to change notification settings - Fork 87
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
base: master
Are you sure you want to change the base?
Conversation
yesterday I disovered serious bug, that cause heap corruption, unfortunately it is in master branch. Within few days I should be able to provide fix. In the meantime you might try to rebase to |
Ok, thanks for the reply!! |
aa3f59c
to
3c29b9a
Compare
I've rolledback bad changes and pushed fix to master. Please check if it still occurs. If you next time get this error, uncoment line |
3c29b9a
to
26c8837
Compare
5fb7ff3
to
72f5db8
Compare
@@ -114,6 +114,22 @@ int IRAM_ATTR EscDriverEsp32::write(size_t channel, int pulse) | |||
return 1; | |||
} | |||
|
|||
int EscDriverEsp32::reverseMotor(size_t channel, bool reverse) |
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.
1d95f0f
to
1c284d2
Compare
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.
I added few more comments in advance, to save your time :)
@@ -114,6 +114,22 @@ int IRAM_ATTR EscDriverEsp32::write(size_t channel, int pulse) | |||
return 1; | |||
} | |||
|
|||
int EscDriverEsp32::reverseMotor(size_t channel, bool reverse) |
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.
lib/EscDriver/src/DshotCommands.hpp
Outdated
#include "EscDriver.h" | ||
|
||
// The official DShot Commands | ||
typedef enum dshot_cmd_e |
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.
I prefer camel case notation for type names. Also typedef is not required here. Just enum DshotCommand
lib/EscDriver/src/EscDriverEsp32.h
Outdated
@@ -99,7 +102,8 @@ class EscDriverEsp32: public EscDriverBase | |||
void transmitAll(); | |||
void readTelemetry(); | |||
void writeAnalogCommand(uint32_t channel, int32_t pulse); | |||
void writeDshotCommand(uint32_t channel, int32_t pulse); | |||
void writeDshotThrottleCommand(uint32_t channel, int32_t pulse); |
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.
don't rename this method name, this cause changes in many places that you haven't explored yet, like unittests or differrent platforms. Just add new method with unique name like writeDshotCustomCommand
8c271e9
to
644f4e8
Compare
644f4e8
to
3954112
Compare
@rtlopez could you test it in one ESC that you ideally knows that support the dshot revert command? Maybe you also can spot something I'm missing for that to work. Technically I should:
but its not working and tried a lot of stuff but there's no comprehensive way to debug what the ESC is doing 😢 |
Closing it since I couldn't make it work and lost hope. |
This code is quite promising, It can also be used to control leds on esc's or to implement beeper. I'll reopen it to not forget and continue some day, thanks. |
❗ WORK IN PROGRESS ❗