Code format fixes

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2016-02-19 16:59:45 +01:00
committed by Julian Oes
parent 3b58cfb89d
commit 8b22bde071
8 changed files with 62 additions and 69 deletions
@@ -37,31 +37,22 @@
using namespace px4muorb; using namespace px4muorb;
/* Flags applied to the allocation of the shared memory for RPC */ /**
#define MUORB_KRAIT_FASTRPC_MEM_FLAGS 0 * Constructor
*/
KraitRpcWrapper::KraitRpcWrapper() {}
/* The ID of the HEAP to be used when allocating shared memory */ /**
//TODO This heap id is used for test purposes. We need to find out the correct one. * destructor
#define MUORB_KRAIT_FASTRPC_HEAP_ID 22 */
KraitRpcWrapper::~KraitRpcWrapper() {}
static char *_TopicNameBuffer = 0; /**
static const int32_t _MAX_TOPIC_NAME_BUFFER = 256; * Initiatizes the rpc channel px4 muorb
*/
static uint8_t *_DataBuffer = 0; bool KraitRpcWrapper::Initialize()
static const uint32_t _MAX_DATA_BUFFER_SIZE = 2048;
static bool _Initialized = false;
// These numbers are based off the fact each fastrpc call for 64K packet is 94us.
// hence we are trying to allocation 64K of byte buffers.
static const uint32_t _MAX_TOPIC_DATA_BUFFER_SIZE = 1024;
static const uint32_t _MAX_TOPICS = 64;
static const uint32_t _MAX_BULK_TRANSFER_BUFFER_SIZE = _MAX_TOPIC_DATA_BUFFER_SIZE * _MAX_TOPICS;
static uint8_t *_BulkTransferBuffer = 0;
px4muorb::KraitRpcWrapper::KraitRpcWrapper()
{ {
return (px4muorb_orb_initialize() == 0);
} }
px4muorb::KraitRpcWrapper::~KraitRpcWrapper() px4muorb::KraitRpcWrapper::~KraitRpcWrapper()
+3 -3
View File
@@ -129,7 +129,8 @@ extern int update_from_shmem(param_t param, union param_value_u *value);
static int param_set_internal(param_t param, const void *val, bool mark_saved, bool notify_changes); static int param_set_internal(param_t param, const void *val, bool mark_saved, bool notify_changes);
unsigned char set_called_from_get = 0; unsigned char set_called_from_get = 0;
static int param_import_done=0; /*at startup, params are loaded from file, if present. we dont want to send notifications that time since muorb is not ready*/ static int param_import_done =
0; /*at startup, params are loaded from file, if present. we dont want to send notifications that time since muorb is not ready*/
static int param_load_default_no_notify(void); static int param_load_default_no_notify(void);
@@ -509,8 +510,7 @@ param_get(param_t param, void *val)
union param_value_u value; union param_value_u value;
if(update_from_shmem(param, &value)) if (update_from_shmem(param, &value)) {
{
set_called_from_get = 1; set_called_from_get = 1;
param_set_internal(param, &value, true, false); param_set_internal(param, &value, true, false);
set_called_from_get = 0; set_called_from_get = 0;
@@ -60,6 +60,7 @@ long PX4_TICKS_PER_SEC = sysconf(_SC_CLK_TCK);
#ifdef ENABLE_SHMEM #ifdef ENABLE_SHMEM
extern void init_params(void); extern void init_params(void);
#endif
#ifdef ENABLE_SHMEM #ifdef ENABLE_SHMEM
extern void init_own_params(void); extern void init_own_params(void);
+1
View File
@@ -124,6 +124,7 @@ load(const char *devname, const char *fname)
#ifndef __PX4_QURT #ifndef __PX4_QURT
char buf[2048]; char buf[2048];
if (load_mixer_file(fname, &buf[0], sizeof(buf)) < 0) { if (load_mixer_file(fname, &buf[0], sizeof(buf)) < 0) {
warnx("can't load mixer: %s", fname); warnx("can't load mixer: %s", fname);
return 1; return 1;