VOXL2 board support updates (#21426)

This commit is contained in:
Eric Katzfey
2023-04-19 08:21:02 -07:00
committed by GitHub
parent cb66c48876
commit 018ca6b49d
17 changed files with 755 additions and 141 deletions
+1 -3
View File
@@ -75,15 +75,13 @@ void WorkerThread::startTask(Request request)
pthread_attr_init(&low_prio_attr);
pthread_attr_setstacksize(&low_prio_attr, PX4_STACK_ADJUSTED(4804));
#ifndef __PX4_QURT
// This is not supported by QURT (yet).
struct sched_param param;
pthread_attr_getschedparam(&low_prio_attr, &param);
/* low priority */
param.sched_priority = SCHED_PRIORITY_DEFAULT - 50;
pthread_attr_setschedparam(&low_prio_attr, &param);
#endif
int ret = pthread_create(&_thread_handle, &low_prio_attr, &threadEntryTrampoline, this);
pthread_attr_destroy(&low_prio_attr);
+17 -50
View File
@@ -35,11 +35,9 @@
#include "uORBAppsProtobufChannel.hpp"
#include "uORB/uORBManager.hpp"
extern "C" { __EXPORT int muorb_main(int argc, char *argv[]); }
static void usage()
{
PX4_INFO("Usage: muorb 'start', 'test', 'stop', 'status'");
extern "C" {
__EXPORT int muorb_main(int argc, char *argv[]);
__EXPORT int muorb_init();
}
static bool enable_debug = false;
@@ -47,52 +45,21 @@ static bool enable_debug = false;
int
muorb_main(int argc, char *argv[])
{
if (argc < 2) {
usage();
return -EINVAL;
return muorb_init();
}
int
muorb_init()
{
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
PX4_INFO("Got muorb init command");
if (channel && channel->Initialize(enable_debug)) {
uORB::Manager::get_instance()->set_uorb_communicator(channel);
if (channel->Test()) { return OK; }
}
// TODO: Add an optional start parameter to control debug messages
if (!strcmp(argv[1], "start")) {
// Register the protobuf channel with UORB.
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
PX4_INFO("Got muorb start command");
if (channel && channel->Initialize(enable_debug)) {
uORB::Manager::get_instance()->set_uorb_communicator(channel);
return OK;
}
} else if (!strcmp(argv[1], "test")) {
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
PX4_INFO("Got muorb test command");
if (channel && channel->Initialize(enable_debug)) {
uORB::Manager::get_instance()->set_uorb_communicator(channel);
if (channel->Test()) { return OK; }
}
} else if (!strcmp(argv[1], "stop")) {
if (uORB::AppsProtobufChannel::isInstance() == false) {
PX4_WARN("muorb not running");
}
return OK;
} else if (!strcmp(argv[1], "status")) {
if (uORB::AppsProtobufChannel::isInstance()) {
PX4_INFO("muorb initialized");
} else {
PX4_INFO("muorb not running");
}
return OK;
}
usage();
return -EINVAL;
}