aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/px4_middleware.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-11-28 16:08:51 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-11-28 16:08:51 +0100
commita9c1e4ad6145485805366fad5c08ae7351886ff3 (patch)
treea32520d33cb1c5b1cf32d6fc640c77634816099b /src/platforms/px4_middleware.h
parentcefccc0037f18275b8d8c7e49e15d13801ef28a1 (diff)
downloadpx4-firmware-a9c1e4ad6145485805366fad5c08ae7351886ff3.tar.gz
px4-firmware-a9c1e4ad6145485805366fad5c08ae7351886ff3.tar.bz2
px4-firmware-a9c1e4ad6145485805366fad5c08ae7351886ff3.zip
make px4::ok work, use it in px4::spin
Diffstat (limited to 'src/platforms/px4_middleware.h')
-rw-r--r--src/platforms/px4_middleware.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/platforms/px4_middleware.h b/src/platforms/px4_middleware.h
index 462a06e97..dece72907 100644
--- a/src/platforms/px4_middleware.h
+++ b/src/platforms/px4_middleware.h
@@ -49,7 +49,12 @@ __EXPORT void init(int argc, char *argv[], const char *process_name);
__EXPORT uint64_t get_time_micros();
-__EXPORT bool ok();
+#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
+bool ok() { return ros::ok(); }
+#else
+extern bool task_should_exit;
+bool ok() { return !task_should_exit; }
+#endif
class Rate
{
@@ -64,6 +69,4 @@ private:
};
-extern bool task_should_exit;
-
} // namespace px4