mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Nicer DSHOT MSP handling
This commit is contained in:
parent
32ec29ccce
commit
f19b508cd4
1 changed files with 4 additions and 1 deletions
|
@ -649,7 +649,10 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
|
|||
#endif
|
||||
case MSP_MOTOR:
|
||||
for (unsigned i = 0; i < 8; i++) {
|
||||
sbufWriteU16(dst, i < MAX_SUPPORTED_MOTORS ? constrain(motor[i], 1, 2047) : 0); // TODO - Fix 0 handling in the configurator. This is just a workaround
|
||||
if (masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT150 || masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT600)
|
||||
sbufWriteU16(dst, i < MAX_SUPPORTED_MOTORS ? constrain((motor[i] / 2) + 1000, 1000, 2000) : 0); // This is to get it working in the configurator
|
||||
else
|
||||
sbufWriteU16(dst, i < MAX_SUPPORTED_MOTORS ? motor[i] : 0);
|
||||
}
|
||||
break;
|
||||
case MSP_RC:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue