Files
PX4-Autopilot/platforms
Nuno Marques b463416559 fix(shutdown): move shutdown_time_us_now() inside workqueue guard
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>
2026-05-07 16:15:31 -07:00
..