Fixed inverted motors
This commit is contained in:
@@ -214,11 +214,13 @@ void RemoteControlCallbacks::onWrite(NimBLECharacteristic* pCharacteristic)
|
|||||||
if (blinkAnimation != newBlinkAnimation) blinkAnimation = newBlinkAnimation;
|
if (blinkAnimation != newBlinkAnimation) blinkAnimation = newBlinkAnimation;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const bool isInverted = (settings.controllerHardware.invertFrontLeft && !settings.controllerHardware.invertFrontRight);
|
||||||
|
|
||||||
if (!simplified)
|
if (!simplified)
|
||||||
{
|
{
|
||||||
modes::remoteControlMode.setCommand(RemoteCommand{
|
modes::remoteControlMode.setCommand(RemoteCommand{
|
||||||
.frontLeft = doc["fl"].as<int16_t>(),
|
.frontLeft = doc[isInverted ? "fr":"fl"].as<int16_t>(),
|
||||||
.frontRight = doc["fr"].as<int16_t>(),
|
.frontRight = doc[isInverted ? "fl":"fr"].as<int16_t>(),
|
||||||
.backLeft = doc["bl"].as<int16_t>(),
|
.backLeft = doc["bl"].as<int16_t>(),
|
||||||
.backRight = doc["br"].as<int16_t>()
|
.backRight = doc["br"].as<int16_t>()
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user