How to avoid motor PWM conflict for self-added flight modes?

We are adding a new flight mode to ArduCopter, and since a self-defined lower-level control is covered (using “motors->rc_write” to produce our own motor output) in this flight mode, on the real drones, we may need to prevent the conflict between the default PWM motor output and our own PWM motor output.

We used to achieve this by skipping the “motors_output();” line in “void Copter::fast_loop()” function for our flight mode in “ArduCopter/Copter.cpp” a year ago, but this function no longer exists in the current Ardupilot, and we’d like to find a more official way.

Could anyone please provide any advice to do this?

#arducopter

2023-05-31T05:00:00Z