Rebase changes on upstream master

This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2016-02-19 16:59:43 +01:00
committed by Julian Oes
parent 2938d23c6c
commit 014f15d8b0
28 changed files with 254 additions and 172 deletions
+22 -21
View File
@@ -73,30 +73,30 @@ static void run_cmd(map<string, px4_main_t> &apps, const vector<string> &appargs
string command = appargs[0];
//replaces app.find with iterator code to avoid null pointer exception
for (map<string, px4_main_t>::iterator it = apps.begin(); it != apps.end(); ++it)
if (it->first == command) {
const char *arg[2 + 1];
for (map<string,px4_main_t>::iterator it=apps.begin(); it!=apps.end(); ++it)
if (it->first == command) {
const char *arg[2 + 1];
unsigned int i = 0;
while (i < appargs.size() && appargs[i].c_str()[0] != '\0') {
arg[i] = (char *)appargs[i].c_str();
PX4_WARN(" arg%d = '%s'\n", i, arg[i]);
++i;
}
arg[i] = (char *)0;
//PX4_DEBUG_PRINTF(i);
if (apps[command] == NULL) {
PX4_ERR("Null function !!\n");
} else {
apps[command](i, (char **)arg);
break;
}
unsigned int i = 0;
while (i < appargs.size() && appargs[i].c_str()[0] != '\0') {
arg[i] = (char *)appargs[i].c_str();
PX4_WARN(" arg%d = '%s'\n", i, arg[i]);
++i;
}
arg[i] = (char *)0;
//PX4_DEBUG_PRINTF(i);
if (apps[command] == NULL) {
PX4_ERR("Null function !!\n");
} else {
apps[command](i, (char **)arg);
break;
}
}
}
void eat_whitespace(const char *&b, int &i)
@@ -115,6 +115,7 @@ static void process_commands(map<string, px4_main_t> &apps, const char *cmds)
const char *b = cmds;
char arg[256];
// Eat leading whitespace
eat_whitespace(b, i);
@@ -71,7 +71,9 @@ unsigned int sleep(unsigned int sec)
}
extern void hrt_init(void);
extern void init_params();
extern void init_own_params();
extern unsigned int init_other_params();
extern unsigned int param_sync_done;
#if 0
void qurt_log(const char *fmt, ...)
@@ -110,8 +112,9 @@ void init_once(void)
hrt_init();
PX4_WARN("after calling hrt_init");
/* Shared memory param sync*/
init_params();
/*Shared memory param sync*/
init_own_params();
param_sync_done=init_other_params();
}
void init(int argc, char *argv[], const char *app_name)