iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.18k stars 1.48k forks source link

Add DSHOT support #1393

Closed Linjieqiang closed 5 years ago

Linjieqiang commented 7 years ago

Port from betaflight.

digitalentity commented 6 years ago

Initial cut of DSHOT implementation - #3879

digitalentity commented 6 years ago

As I said - on new timer framework implementation is trivial

TwoToneEddy commented 6 years ago

So you've done it already! That was quick! Sorry I couldn't pull my finger out in time, once I'm up and running I really hope I can contribute.

digitalentity commented 6 years ago

@TwoToneEddy yep, new timer framework made it so trivial that I decided to go for it. Basically these ~140 lines of code are DSHOT protocol: https://github.com/iNavFlight/inav/blob/51dff7c844fd7690e8da687cbc2dc993540804ef/src/main/drivers/pwm_output.c#L196-L299

and mixer output conversion to DSHOT scale: https://github.com/iNavFlight/inav/blob/51dff7c844fd7690e8da687cbc2dc993540804ef/src/main/flight/mixer.c#L187-L218

One thing that will make code easier to understand is mixer change to [-1;1] scale which I might go for next.

DzikuVx commented 5 years ago

I think we can close it as done in 2.1