Adds dshot reverse commands support#157
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
| return 1; | ||
| } | ||
|
|
||
| int EscDriverEsp32::reverseMotor(size_t channel, bool reverse) |
There was a problem hiding this comment.
@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.
_model.state.mixer.escMotor->reverseMotor(), but check first if pointer is initialized.
1d95f0f to
1c284d2
Compare
rtlopez
left a comment
There was a problem hiding this comment.
I added few more comments in advance, to save your time :)
| return 1; | ||
| } | ||
|
|
||
| int EscDriverEsp32::reverseMotor(size_t channel, bool reverse) |
There was a problem hiding this comment.
_model.state.mixer.escMotor->reverseMotor(), but check first if pointer is initialized.
| #include "EscDriver.h" | ||
|
|
||
| // The official DShot Commands | ||
| typedef enum dshot_cmd_e |
There was a problem hiding this comment.
I prefer camel case notation for type names. Also typedef is not required here. Just enum DshotCommand
| 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.
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 ❗