mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 08:50:35 +08:00
committed by
Julian Oes
parent
3b58cfb89d
commit
8b22bde071
@@ -60,6 +60,7 @@ long PX4_TICKS_PER_SEC = sysconf(_SC_CLK_TCK);
|
||||
|
||||
#ifdef ENABLE_SHMEM
|
||||
extern void init_params(void);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_SHMEM
|
||||
extern void init_own_params(void);
|
||||
@@ -85,7 +86,7 @@ void init_once(void)
|
||||
#ifdef ENABLE_SHMEM
|
||||
PX4_INFO("Starting shared memory param sync\n");
|
||||
init_own_params();
|
||||
param_sync_done=init_other_params();
|
||||
param_sync_done = init_other_params();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
|
||||
int mem_fd;
|
||||
unsigned char *map_base, *virt_addr;
|
||||
struct shmem_info* shmem_info_p;
|
||||
static void* map_memory(off_t target);
|
||||
struct shmem_info *shmem_info_p;
|
||||
static void *map_memory(off_t target);
|
||||
|
||||
int get_shmem_lock(void);
|
||||
void release_shmem_lock(void);
|
||||
|
||||
@@ -331,7 +331,7 @@ int VCDevExample::main()
|
||||
|
||||
PX4_INFO("TEST: ZERO TIMEOUT POLL -----------");
|
||||
|
||||
if(do_poll(fd, 0, 3, 0)) {
|
||||
if (do_poll(fd, 0, 3, 0)) {
|
||||
ret = 1;
|
||||
goto fail2;
|
||||
goto fail2;
|
||||
|
||||
@@ -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;
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
@@ -114,7 +114,7 @@ void init_once(void)
|
||||
|
||||
/*Shared memory param sync*/
|
||||
init_own_params();
|
||||
param_sync_done=init_other_params();
|
||||
param_sync_done = init_other_params();
|
||||
}
|
||||
|
||||
void init(int argc, char *argv[], const char *app_name)
|
||||
|
||||
Reference in New Issue
Block a user