make px4::ok work, use it in px4::spin

This commit is contained in:
Thomas Gubler
2014-11-28 16:08:51 +01:00
parent cefccc0037
commit a9c1e4ad61
7 changed files with 24 additions and 41 deletions
+1 -4
View File
@@ -35,9 +35,6 @@
# NuttX / uORB adapter library
#
SRCS = px4_nuttx_impl.cpp \
px4_publisher.cpp \
px4_subscriber.cpp \
px4_nodehandle.cpp
SRCS = px4_nuttx_impl.cpp
MAXOPTIMIZATION = -Os
-19
View File
@@ -37,27 +37,8 @@
* PX4 Middleware Wrapper Nodehandle
*/
#include <px4.h>
#include <platforms/px4_nodehandle.h>
namespace px4
{
bool task_should_exit = false;
void NodeHandle::spinOnce() {
/* Loop through subscriptions, call callback for updated subscriptions */
uORB::SubscriptionNode *sub = _subs.getHead();
int count = 0;
while (sub != nullptr) {
if (count++ > kMaxSubscriptions) {
PX4_WARN("exceeded max subscriptions");
break;
}
sub->update();
sub = sub->getSibling();
}
}
}
-5
View File
@@ -54,9 +54,4 @@ uint64_t get_time_micros()
return hrt_absolute_time();
}
bool ok()
{
return !task_should_exit;
}
}