Modification motor arming Sequence


recently Im studying about ardupilot code
so now i’m trying to modify motor arm Sequence.

I just wanna make motors spin sequently
but isn’t working

I modified Code in library/AP_motormatrix.cpp

case SpoolState::GROUND_IDLE:
// sends output to motors when armed but not flying
for (i = 0; i < AP_MOTORS_MAX_NUM_MOTORS; i++) {
if (motor_enabled[i]) {
set_actuator_with_slew(_actuator[i], actuator_spin_up_to_ground_idle());

I upload that master code to my Drone and click that Arm/Disarm button in Mission planner Action banner
but only emit that arming sound but motors didn’t work…

and Initialising Ardupilot Message Keep apper in Message screen

How to do that
Please let me know
thank you.

You probably are not allowed to do the " hal.scheduler->delay(1000)" function call on that particular thread. Try renmoving it.

Thank you for answer

well… i changed code like “delay(1000) , delay(100), delay(10) etc…” but 100 and 10 is work.
Motor spin sequently. but little slow to motor arm.

Is there any failsafe or orther arming check in the Logic to prevent delay ??

If the delay is too big the operating system will trigger a internal error.