From 047578a844ff4a42049b19b59cf0579507bc6a18 Mon Sep 17 00:00:00 2001 From: Alexander Lerach Date: Mon, 10 Feb 2025 18:16:48 +0100 Subject: [PATCH] Disarm PWM ESCs before reboot --- boards/3dr/ctrl-zero-h7-oem-revg/src/init.c | 7 ++++++- boards/ark/fmu-v6x/src/init.c | 7 ++++++- boards/ark/fpv/src/init.c | 7 ++++++- boards/ark/pi6x/src/init.c | 7 ++++++- boards/av/x-v1/src/init.c | 7 ++++++- boards/cuav/7-nano/src/init.c | 7 ++++++- boards/cuav/nora/src/init.c | 7 ++++++- boards/cuav/x7pro/src/init.c | 7 ++++++- boards/cubepilot/cubeorange/src/init.c | 7 ++++++- boards/cubepilot/cubeorangeplus/src/init.c | 7 ++++++- boards/cubepilot/cubeyellow/src/init.c | 7 ++++++- boards/hkust/nxt-dual/src/init.c | 7 ++++++- boards/hkust/nxt-v1/src/init.c | 7 ++++++- boards/holybro/durandal-v1/src/init.c | 7 ++++++- boards/holybro/kakutef7/src/init.c | 7 ++++++- boards/holybro/kakuteh7/src/init.c | 7 ++++++- boards/holybro/kakuteh7mini/src/init.c | 7 ++++++- boards/holybro/kakuteh7v2/src/init.c | 7 ++++++- boards/holybro/pix32v5/src/init.c | 7 ++++++- boards/matek/h743-mini/src/init.c | 7 ++++++- boards/matek/h743-slim/src/init.c | 7 ++++++- boards/matek/h743/src/init.c | 7 ++++++- boards/micoair/h743-aio/src/init.c | 7 ++++++- boards/micoair/h743-v2/src/init.c | 7 ++++++- boards/micoair/h743/src/init.c | 7 ++++++- boards/modalai/fc-v1/src/init.c | 7 ++++++- boards/modalai/fc-v2/src/init.c | 7 ++++++- boards/mro/ctrl-zero-classic/src/init.c | 7 ++++++- boards/mro/ctrl-zero-f7-oem/src/init.c | 7 ++++++- boards/mro/ctrl-zero-f7/src/init.c | 7 ++++++- boards/mro/ctrl-zero-h7-oem/src/init.c | 7 ++++++- boards/mro/ctrl-zero-h7/src/init.c | 7 ++++++- boards/mro/pixracerpro/src/init.c | 7 ++++++- boards/mro/x21-777/src/init.c | 10 +++++----- boards/nxp/fmuk66-e/src/init.c | 7 ++++++- boards/nxp/fmuk66-v3/src/init.c | 7 ++++++- boards/nxp/tropic-community/src/init.c | 7 ++++++- boards/px4/fmu-v5/src/init.c | 7 ++++++- boards/px4/fmu-v5x/src/init.cpp | 7 ++++++- boards/px4/fmu-v6c/src/init.c | 7 ++++++- boards/px4/fmu-v6u/src/init.c | 7 ++++++- boards/px4/fmu-v6x/src/init.cpp | 7 ++++++- boards/px4/fmu-v6xrt/src/init.c | 7 ++++++- boards/siyi/n7/src/init.c | 7 ++++++- boards/sky-drones/smartap-airlink/src/init.cpp | 7 ++++++- boards/spracing/h7extreme/src/init.c | 7 ++++++- boards/x-mav/ap-h743v2/src/init.c | 7 ++++++- boards/zeroone/x6/src/init.c | 7 ++++++- 48 files changed, 287 insertions(+), 52 deletions(-) diff --git a/boards/3dr/ctrl-zero-h7-oem-revg/src/init.c b/boards/3dr/ctrl-zero-h7-oem-revg/src/init.c index daaace48fb..0081dc62dd 100755 --- a/boards/3dr/ctrl-zero-h7-oem-revg/src/init.c +++ b/boards/3dr/ctrl-zero-h7-oem-revg/src/init.c @@ -107,8 +107,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/ark/fmu-v6x/src/init.c b/boards/ark/fmu-v6x/src/init.c index 56c94f805b..6c1c2257ed 100644 --- a/boards/ark/fmu-v6x/src/init.c +++ b/boards/ark/fmu-v6x/src/init.c @@ -150,8 +150,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/ark/fpv/src/init.c b/boards/ark/fpv/src/init.c index 5e321b3b52..cbd9382238 100644 --- a/boards/ark/fpv/src/init.c +++ b/boards/ark/fpv/src/init.c @@ -145,8 +145,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/ark/pi6x/src/init.c b/boards/ark/pi6x/src/init.c index 90bb4fc128..4dcef47cac 100644 --- a/boards/ark/pi6x/src/init.c +++ b/boards/ark/pi6x/src/init.c @@ -141,8 +141,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/av/x-v1/src/init.c b/boards/av/x-v1/src/init.c index 8e12ee823e..0f455559f1 100644 --- a/boards/av/x-v1/src/init.c +++ b/boards/av/x-v1/src/init.c @@ -94,8 +94,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cuav/7-nano/src/init.c b/boards/cuav/7-nano/src/init.c index 3bd2164622..6ee02bb529 100644 --- a/boards/cuav/7-nano/src/init.c +++ b/boards/cuav/7-nano/src/init.c @@ -142,8 +142,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cuav/nora/src/init.c b/boards/cuav/nora/src/init.c index d4c262b76a..a8f3bf4ad3 100644 --- a/boards/cuav/nora/src/init.c +++ b/boards/cuav/nora/src/init.c @@ -113,8 +113,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cuav/x7pro/src/init.c b/boards/cuav/x7pro/src/init.c index d4c262b76a..a8f3bf4ad3 100644 --- a/boards/cuav/x7pro/src/init.c +++ b/boards/cuav/x7pro/src/init.c @@ -113,8 +113,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cubepilot/cubeorange/src/init.c b/boards/cubepilot/cubeorange/src/init.c index f7e1b3ca77..9bf3d5f58e 100644 --- a/boards/cubepilot/cubeorange/src/init.c +++ b/boards/cubepilot/cubeorange/src/init.c @@ -104,8 +104,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cubepilot/cubeorangeplus/src/init.c b/boards/cubepilot/cubeorangeplus/src/init.c index f7e1b3ca77..9bf3d5f58e 100644 --- a/boards/cubepilot/cubeorangeplus/src/init.c +++ b/boards/cubepilot/cubeorangeplus/src/init.c @@ -104,8 +104,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/cubepilot/cubeyellow/src/init.c b/boards/cubepilot/cubeyellow/src/init.c index 8ba8972402..0eb3701c04 100644 --- a/boards/cubepilot/cubeyellow/src/init.c +++ b/boards/cubepilot/cubeyellow/src/init.c @@ -102,8 +102,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/hkust/nxt-dual/src/init.c b/boards/hkust/nxt-dual/src/init.c index 657c0080c0..cd7d3d2162 100644 --- a/boards/hkust/nxt-dual/src/init.c +++ b/boards/hkust/nxt-dual/src/init.c @@ -100,8 +100,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/hkust/nxt-v1/src/init.c b/boards/hkust/nxt-v1/src/init.c index 657c0080c0..cd7d3d2162 100644 --- a/boards/hkust/nxt-v1/src/init.c +++ b/boards/hkust/nxt-v1/src/init.c @@ -100,8 +100,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/durandal-v1/src/init.c b/boards/holybro/durandal-v1/src/init.c index f8dc55d72f..283b44842e 100644 --- a/boards/holybro/durandal-v1/src/init.c +++ b/boards/holybro/durandal-v1/src/init.c @@ -144,8 +144,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/kakutef7/src/init.c b/boards/holybro/kakutef7/src/init.c index 9b8a0140f4..e4b6bae87d 100644 --- a/boards/holybro/kakutef7/src/init.c +++ b/boards/holybro/kakutef7/src/init.c @@ -124,8 +124,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/kakuteh7/src/init.c b/boards/holybro/kakuteh7/src/init.c index cf73735aed..9c609d4486 100644 --- a/boards/holybro/kakuteh7/src/init.c +++ b/boards/holybro/kakuteh7/src/init.c @@ -129,8 +129,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/kakuteh7mini/src/init.c b/boards/holybro/kakuteh7mini/src/init.c index c8f19df734..4691703e8f 100644 --- a/boards/holybro/kakuteh7mini/src/init.c +++ b/boards/holybro/kakuteh7mini/src/init.c @@ -127,8 +127,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/kakuteh7v2/src/init.c b/boards/holybro/kakuteh7v2/src/init.c index 7e55cc1770..bff6e6535a 100644 --- a/boards/holybro/kakuteh7v2/src/init.c +++ b/boards/holybro/kakuteh7v2/src/init.c @@ -127,8 +127,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/holybro/pix32v5/src/init.c b/boards/holybro/pix32v5/src/init.c index 2153838a60..fd2449ee7d 100644 --- a/boards/holybro/pix32v5/src/init.c +++ b/boards/holybro/pix32v5/src/init.c @@ -143,8 +143,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/matek/h743-mini/src/init.c b/boards/matek/h743-mini/src/init.c index bb1c6f975c..9ffa799caf 100644 --- a/boards/matek/h743-mini/src/init.c +++ b/boards/matek/h743-mini/src/init.c @@ -94,8 +94,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/matek/h743-slim/src/init.c b/boards/matek/h743-slim/src/init.c index f78e570c5a..899bb1ba4d 100644 --- a/boards/matek/h743-slim/src/init.c +++ b/boards/matek/h743-slim/src/init.c @@ -98,8 +98,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/matek/h743/src/init.c b/boards/matek/h743/src/init.c index a2a531882c..f24ad5eb7c 100644 --- a/boards/matek/h743/src/init.c +++ b/boards/matek/h743/src/init.c @@ -94,8 +94,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/micoair/h743-aio/src/init.c b/boards/micoair/h743-aio/src/init.c index 43f86f902d..c0e1f9776c 100644 --- a/boards/micoair/h743-aio/src/init.c +++ b/boards/micoair/h743-aio/src/init.c @@ -98,8 +98,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/micoair/h743-v2/src/init.c b/boards/micoair/h743-v2/src/init.c index 43f86f902d..c0e1f9776c 100644 --- a/boards/micoair/h743-v2/src/init.c +++ b/boards/micoair/h743-v2/src/init.c @@ -98,8 +98,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/micoair/h743/src/init.c b/boards/micoair/h743/src/init.c index 43f86f902d..c0e1f9776c 100644 --- a/boards/micoair/h743/src/init.c +++ b/boards/micoair/h743/src/init.c @@ -98,8 +98,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/modalai/fc-v1/src/init.c b/boards/modalai/fc-v1/src/init.c index beee10b875..254d5b3397 100644 --- a/boards/modalai/fc-v1/src/init.c +++ b/boards/modalai/fc-v1/src/init.c @@ -141,8 +141,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/modalai/fc-v2/src/init.c b/boards/modalai/fc-v2/src/init.c index dbc6ec4637..651c301072 100644 --- a/boards/modalai/fc-v2/src/init.c +++ b/boards/modalai/fc-v2/src/init.c @@ -139,8 +139,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/ctrl-zero-classic/src/init.c b/boards/mro/ctrl-zero-classic/src/init.c index daaace48fb..0081dc62dd 100644 --- a/boards/mro/ctrl-zero-classic/src/init.c +++ b/boards/mro/ctrl-zero-classic/src/init.c @@ -107,8 +107,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/ctrl-zero-f7-oem/src/init.c b/boards/mro/ctrl-zero-f7-oem/src/init.c index 0b0b07ff12..af04388898 100644 --- a/boards/mro/ctrl-zero-f7-oem/src/init.c +++ b/boards/mro/ctrl-zero-f7-oem/src/init.c @@ -132,8 +132,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/ctrl-zero-f7/src/init.c b/boards/mro/ctrl-zero-f7/src/init.c index 0b0b07ff12..af04388898 100644 --- a/boards/mro/ctrl-zero-f7/src/init.c +++ b/boards/mro/ctrl-zero-f7/src/init.c @@ -132,8 +132,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/ctrl-zero-h7-oem/src/init.c b/boards/mro/ctrl-zero-h7-oem/src/init.c index daaace48fb..0081dc62dd 100644 --- a/boards/mro/ctrl-zero-h7-oem/src/init.c +++ b/boards/mro/ctrl-zero-h7-oem/src/init.c @@ -107,8 +107,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/ctrl-zero-h7/src/init.c b/boards/mro/ctrl-zero-h7/src/init.c index daaace48fb..0081dc62dd 100644 --- a/boards/mro/ctrl-zero-h7/src/init.c +++ b/boards/mro/ctrl-zero-h7/src/init.c @@ -107,8 +107,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/pixracerpro/src/init.c b/boards/mro/pixracerpro/src/init.c index 481c35c336..6fe192857e 100644 --- a/boards/mro/pixracerpro/src/init.c +++ b/boards/mro/pixracerpro/src/init.c @@ -107,8 +107,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/mro/x21-777/src/init.c b/boards/mro/x21-777/src/init.c index 3f5f00e377..dd6edda517 100644 --- a/boards/mro/x21-777/src/init.c +++ b/boards/mro/x21-777/src/init.c @@ -106,13 +106,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); } - /** - * On resets invoked from system (not boot) insure we establish a low - * output state (discharge the pins) on PWM pins before they become inputs. + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. */ - if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/nxp/fmuk66-e/src/init.c b/boards/nxp/fmuk66-e/src/init.c index affa94492e..e8580466b2 100644 --- a/boards/nxp/fmuk66-e/src/init.c +++ b/boards/nxp/fmuk66-e/src/init.c @@ -120,8 +120,13 @@ void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/nxp/fmuk66-v3/src/init.c b/boards/nxp/fmuk66-v3/src/init.c index 57e8633459..d5bc68d52e 100644 --- a/boards/nxp/fmuk66-v3/src/init.c +++ b/boards/nxp/fmuk66-v3/src/init.c @@ -120,8 +120,13 @@ void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/nxp/tropic-community/src/init.c b/boards/nxp/tropic-community/src/init.c index 8e5db86b37..a9c326f39c 100644 --- a/boards/nxp/tropic-community/src/init.c +++ b/boards/nxp/tropic-community/src/init.c @@ -134,8 +134,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_gpio_output(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v5/src/init.c b/boards/px4/fmu-v5/src/init.c index cfec81bae6..660a338b20 100644 --- a/boards/px4/fmu-v5/src/init.c +++ b/boards/px4/fmu-v5/src/init.c @@ -143,8 +143,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v5x/src/init.cpp b/boards/px4/fmu-v5x/src/init.cpp index c4debd31ae..b743bf1310 100644 --- a/boards/px4/fmu-v5x/src/init.cpp +++ b/boards/px4/fmu-v5x/src/init.cpp @@ -145,8 +145,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v6c/src/init.c b/boards/px4/fmu-v6c/src/init.c index 5a853b31b1..ff8d7a8b3c 100644 --- a/boards/px4/fmu-v6c/src/init.c +++ b/boards/px4/fmu-v6c/src/init.c @@ -137,8 +137,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v6u/src/init.c b/boards/px4/fmu-v6u/src/init.c index 1563331909..ce67db5066 100644 --- a/boards/px4/fmu-v6u/src/init.c +++ b/boards/px4/fmu-v6u/src/init.c @@ -144,8 +144,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v6x/src/init.cpp b/boards/px4/fmu-v6x/src/init.cpp index 4924120123..d914b75497 100644 --- a/boards/px4/fmu-v6x/src/init.cpp +++ b/boards/px4/fmu-v6x/src/init.cpp @@ -145,8 +145,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/px4/fmu-v6xrt/src/init.c b/boards/px4/fmu-v6xrt/src/init.c index 57ac95ce20..25faa213f5 100644 --- a/boards/px4/fmu-v6xrt/src/init.c +++ b/boards/px4/fmu-v6xrt/src/init.c @@ -153,8 +153,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_gpio_output(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/siyi/n7/src/init.c b/boards/siyi/n7/src/init.c index 46cf4ae4aa..bc8147ece1 100644 --- a/boards/siyi/n7/src/init.c +++ b/boards/siyi/n7/src/init.c @@ -136,8 +136,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/sky-drones/smartap-airlink/src/init.cpp b/boards/sky-drones/smartap-airlink/src/init.cpp index c4b4c1fa7e..73a9582f9b 100644 --- a/boards/sky-drones/smartap-airlink/src/init.cpp +++ b/boards/sky-drones/smartap-airlink/src/init.cpp @@ -142,8 +142,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/spracing/h7extreme/src/init.c b/boards/spracing/h7extreme/src/init.c index b241fb6286..38e7d0cbe8 100644 --- a/boards/spracing/h7extreme/src/init.c +++ b/boards/spracing/h7extreme/src/init.c @@ -125,8 +125,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/x-mav/ap-h743v2/src/init.c b/boards/x-mav/ap-h743v2/src/init.c index 657c0080c0..cd7d3d2162 100644 --- a/boards/x-mav/ap-h743v2/src/init.c +++ b/boards/x-mav/ap-h743v2/src/init.c @@ -100,8 +100,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(PX4_MAKE_GPIO_INPUT(io_timer_channel_get_as_pwm_input(i))); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } } diff --git a/boards/zeroone/x6/src/init.c b/boards/zeroone/x6/src/init.c index cd6714af16..6320b5580e 100644 --- a/boards/zeroone/x6/src/init.c +++ b/boards/zeroone/x6/src/init.c @@ -144,8 +144,13 @@ __EXPORT void board_on_reset(int status) px4_arch_configgpio(io_timer_channel_get_gpio_output(i)); } + /* + * On resets invoked from system (not boot) ensure we establish a low + * output state on PWM pins to disarm the ESC and prevent the reset from potentially + * spinning up the motors. + */ if (status >= 0) { - up_mdelay(6); + up_mdelay(100); } }