mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:43:34 +08:00
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:
committed by
Julian Oes
parent
2938d23c6c
commit
014f15d8b0
@@ -60,6 +60,11 @@ long PX4_TICKS_PER_SEC = sysconf(_SC_CLK_TCK);
|
||||
|
||||
#ifdef ENABLE_SHMEM
|
||||
extern void init_params(void);
|
||||
|
||||
#ifdef ENABLE_SHMEM
|
||||
extern void init_own_params(void);
|
||||
extern unsigned int init_other_params(void);
|
||||
extern unsigned int param_sync_done;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
@@ -78,8 +83,9 @@ void init_once(void)
|
||||
hrt_init();
|
||||
|
||||
#ifdef ENABLE_SHMEM
|
||||
PX4_INFO("Syncing params to shared memory\n");
|
||||
init_params();
|
||||
PX4_INFO("Starting shared memory param sync\n");
|
||||
init_own_params();
|
||||
param_sync_done=init_other_params();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (c) 2015 Vijay Venkatraman. All rights reserved.
|
||||
* Copyright (c) 2015 Ramakrishna Kintada. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,6 +32,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include <px4_defines.h>
|
||||
#include <px4_posix.h>
|
||||
#include <string.h>
|
||||
@@ -56,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);
|
||||
@@ -236,6 +238,7 @@ static void update_index_from_shmem(void)
|
||||
release_shmem_lock();
|
||||
}
|
||||
|
||||
|
||||
static void update_value_from_shmem(param_t param, union param_value_u *value)
|
||||
{
|
||||
unsigned int byte_changed, bit_changed;
|
||||
|
||||
@@ -61,10 +61,12 @@ static int writer_main(int argc, char *argv[])
|
||||
|
||||
int fd = px4_open(TESTDEV, PX4_F_WRONLY);
|
||||
|
||||
int fd = px4_open(TESTDEV, PX4_F_WRONLY);
|
||||
if (fd < 0) {
|
||||
PX4_INFO("Writer: Open failed %d %d", fd, px4_errno);
|
||||
return -px4_errno;
|
||||
}
|
||||
src/platforms/posix/tests/vcdev_test/vcdevtest_example.cpp
|
||||
|
||||
int ret;
|
||||
int i = 0;
|
||||
@@ -92,6 +94,12 @@ static int writer_main(int argc, char *argv[])
|
||||
|
||||
class PrivData
|
||||
{
|
||||
PrivData() : _read_offset(0) {}
|
||||
~PrivData() {}
|
||||
|
||||
size_t _read_offset;
|
||||
};
|
||||
|
||||
public:
|
||||
PrivData() : _read_offset(0) {}
|
||||
~PrivData() {}
|
||||
@@ -321,12 +329,16 @@ int VCDevExample::main()
|
||||
(char *const *)NULL);
|
||||
|
||||
ret = 0;
|
||||
|
||||
PX4_INFO("TEST: BLOCKING POLL ---------------");
|
||||
|
||||
if (do_poll(fd, -1, 3, 0)) {
|
||||
ret = 1;
|
||||
goto fail2;
|
||||
PX4_INFO("TEST: ZERO TIMEOUT POLL -----------");
|
||||
if(do_poll(fd, 0, 3, 0)) {
|
||||
ret = 1;
|
||||
goto fail2;
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
PX4_INFO("TEST: ZERO TIMEOUT POLL -----------");
|
||||
|
||||
Reference in New Issue
Block a user