@@ -600,7 +600,8 @@ class RCMv3ParameterHelper {
600600 return {
601601 { " pwmChannel" , RC_DATA_Int },
602602 { " pwmPin" , RC_DATA_Pin },
603- { " dirPin" , RC_DATA_Pin }
603+ { " dirPin" , RC_DATA_Pin },
604+ { " reverse" , RC_DATA_Bool }
604605 };
605606 } // end of switch
606607 return {};
@@ -837,10 +838,10 @@ class RCMv3ComponentJMotorDriverEsp32HBridge : public RCMv3ComponentJMotorDriver
837838
838839class RCMv3ComponentJMotorDriverEsp32PWMDir : public RCMv3ComponentJMotorDriver {
839840public:
840- RCMv3ComponentJMotorDriverEsp32PWMDir (int pwmChannel, int pwmPin, int dirPin)
841+ RCMv3ComponentJMotorDriverEsp32PWMDir (int pwmChannel, int pwmPin, int dirPin, bool reverse )
841842 : RCMv3ComponentJMotorDriver(RC_Type_JMotorDriverEsp32PWMDir)
842843 {
843- internalInstance = new JMotorDriverEsp32PWMDir (pwmChannel, pwmPin, dirPin);
844+ internalInstance = new JMotorDriverEsp32PWMDir (pwmChannel, pwmPin, dirPin, reverse );
844845 }
845846 ~RCMv3ComponentJMotorDriverEsp32PWMDir ()
846847 {
@@ -1917,8 +1918,8 @@ class RCMv3ComponentFactory {
19171918 components.push_back (new RCMv3ComponentJMotorDriverEsp32HBridge ((int )data[0 ], (int )data[1 ], (int )data[2 ]));
19181919 } break ;
19191920 case RC_Type_JMotorDriverEsp32PWMDir: {
1920- Serial.printf (" creating JMotorDriverEsp32PWMDir with pwmChannel %d and pwmPin %d and dirPin %d\n " , (int )data[0 ], (int )data[1 ], (int )data[2 ]);
1921- components.push_back (new RCMv3ComponentJMotorDriverEsp32PWMDir ((int )data[0 ], (int )data[1 ], (int )data[2 ]));
1921+ Serial.printf (" creating JMotorDriverEsp32PWMDir with pwmChannel %d and pwmPin %d and dirPin %d and reverse %d \n " , (int )data[0 ], (int )data[1 ], (int )data[2 ], ( bool )data[ 3 ]);
1922+ components.push_back (new RCMv3ComponentJMotorDriverEsp32PWMDir ((int )data[0 ], (int )data[1 ], (int )data[2 ], ( bool )data[ 3 ] ));
19221923 } break ;
19231924 case RC_TYPE_BSED: {
19241925 Serial.printf (" creating BSED with wire %d and address %d\n " , (int )data[0 ], (int )data[1 ]);
0 commit comments