mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 06:39:25 +08:00
b463416559
shutdown_time_us_now() was defined unconditionally at file scope but its
only callers (shutdown_worker, px4_reboot_request, px4_shutdown_request)
all live inside
#if defined(CONFIG_SCHED_WORKQUEUE) || \
(!defined(CONFIG_BUILD_FLAT) && defined(CONFIG_LIBC_USRWORK))
On NuttX bootloader builds and on flat-build defconfigs without
CONFIG_LIBC_USRWORK the function was therefore dead code, and the
NuttX build flags include -Werror=unused-function which made it a
fatal error across stm32f4 / stm32h7 / imxrt / s32k / kinetis board
targets.
Move the helper inside the same guard as its callers so it only exists
where it is used. No behavioural change for builds that already linked
against it.
Signed-off-by: Nuno Marques <n.marques21@hotmail.com>