diff --git a/platforms/posix/src/px4/windows/tests/test_windows_shim_headers.cpp b/platforms/posix/src/px4/windows/tests/test_windows_shim_headers.cpp index 06e91c30c7..5b12dc22fa 100644 --- a/platforms/posix/src/px4/windows/tests/test_windows_shim_headers.cpp +++ b/platforms/posix/src/px4/windows/tests/test_windows_shim_headers.cpp @@ -52,6 +52,17 @@ #include #include +/* The shim header for usleep references three tunables that are normally + * defined in platforms/posix/src/px4/windows/runtime/init.cpp. This unit + * test binary intentionally does not link init.cpp (it would drag in the + * full runtime), so we provide local definitions matching the documented + * defaults. Keep them in sync with init.cpp. */ +extern "C" { + long g_usleep_pure_spin_us = 5000; + long g_usleep_spin_tail_us = 1000; + long g_usleep_adaptive_min_tail_us = 700; +} + /* Pull headers via the shim include path so the inline functions under * test are the same definitions PX4 sources see. */ #include