QuRT: toolchain changes

Reworking toolchain and main.cpp for QuRT to a final link can be
done and the apps.h file is autogenerated.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-05-12 11:37:28 -07:00
parent 14cbd240ff
commit 3db5f3bb3b
10 changed files with 109 additions and 84 deletions
+7 -9
View File
@@ -37,12 +37,9 @@
* @author Mark Charlebois <charlebm@gmail.com>
*/
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <hexagon_standalone.h>
//#include <hexagon_standalone.h>
//using namespace std;
@@ -52,7 +49,6 @@
#include "px4_middleware.h"
static const char *commands =
"x\n"
"hello start"
#if 0
"uorb start\n"
@@ -79,15 +75,15 @@ static const char *commands =
static void run_cmd(const vector<string> &appargs) {
// command is appargs[0]
string command = appargs[0];
printf("Looking for %s\n", command.c_str());
//printf("Looking for %s\n", command.c_str());
if (apps.find(command) != apps.end()) {
const char *arg[2+1];
unsigned int i = 0;
printf("size = %d\n", appargs.size());
//printf("size = %d\n", appargs.size());
while (i < appargs.size() && appargs[i].c_str()[0] != '\0') {
arg[i] = (char *)appargs[i].c_str();
printf(" arg = '%s'\n", arg[i]);
//printf(" arg = '%s'\n", arg[i]);
++i;
}
arg[i] = (char *)0;
@@ -97,7 +93,7 @@ static void run_cmd(const vector<string> &appargs) {
}
else
{
cout << "Invalid command" << endl;
//cout << "Invalid command" << endl;
list_builtins();
}
}
@@ -159,8 +155,10 @@ extern void init_once(void);
int main(int argc, char **argv)
{
printf("In main\n");
px4::init_once();
px4::init(argc, argv, "mainapp");
process_commands(commands);
for (;;) {}
}
+11 -1
View File
@@ -35,6 +35,15 @@
# NuttX / uORB adapter library
#
SRCDIR=$(dir $(MODULE_MK))
apps.h: $(PX4_BASE)/Tools/qurt_apps.py
$(PX4_BASE)/Tools/qurt_apps.py > $@
# Force creation of apps.h
main_.cpp: $(SRCDIR)/../main.cpp apps.h
cp $(SRCDIR)/../main.cpp $@
SRCS = \
px4_qurt_impl.cpp \
px4_qurt_tasks.cpp \
@@ -49,6 +58,7 @@ SRCS = \
sq_addlast.c \
sq_remfirst.c \
sq_addafter.c \
dq_rem.c
dq_rem.c \
main_.cpp
MAXOPTIMIZATION = -Os
+16 -15
View File
@@ -46,7 +46,9 @@
#include <signal.h>
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include "systemlib/param/param.h"
#include <hexagon_standalone.h>
__BEGIN_DECLS
@@ -58,6 +60,14 @@ unsigned int sleep(unsigned int sec) { return 0; }
extern void hrt_init(void);
void qurt_log(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
printf(fmt, args);
printf("n");
}
__END_DECLS
extern struct wqueue_s gwork[NWORKERS];
@@ -71,12 +81,7 @@ void init_once(void)
{
work_queues_init();
hrt_init();
}
void init(int argc, char *argv[], const char *app_name)
{
printf("App name: %s\n", app_name);
// Create high priority worker thread
g_work[HPWORK].pid = px4_task_spawn_cmd("wkr_high",
SCHED_DEFAULT,
@@ -95,6 +100,11 @@ void init(int argc, char *argv[], const char *app_name)
}
void init(int argc, char *argv[], const char *app_name)
{
PX4_DEBUG("App name: %s\n", app_name);
}
}
/** Retrieve from the data manager store */
@@ -131,12 +141,3 @@ size_t strnlen(const char *s, size_t maxlen)
return i;
}
void qurt_log(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
printf("\n");
}