Move common shmem parameter declarations to shmem.h.

This commit is contained in:
Kārlis Seņko
2018-12-11 09:21:15 -05:00
committed by Daniel Agar
parent d1a1a1b9fe
commit c1d50d35d3
7 changed files with 23 additions and 40 deletions
+1 -15
View File
@@ -120,24 +120,10 @@ int size_param_changed_storage_bytes = 0;
const int bits_per_allocation_unit = (sizeof(*param_changed_storage) * 8);
//#define ENABLE_SHMEM_DEBUG
extern int get_shmem_lock(const char *caller_file_name, int caller_line_number);
extern void release_shmem_lock(const char *caller_file_name, int caller_line_number);
static void init_params();
extern void init_shared_memory();
extern void copy_params_to_shmem(const param_info_s *param_info_base);
extern struct shmem_info *shmem_info_p;
uint64_t sync_other_prev_time = 0, sync_other_current_time = 0;
extern void update_to_shmem(param_t param, union param_value_u value);
extern int update_from_shmem(param_t param, union param_value_u *value);
extern void update_index_from_shmem();
static int param_set_internal(param_t param, const void *val, bool mark_saved, bool notify_changes);
unsigned char set_called_from_get = 0;
static 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*/
-5
View File
@@ -47,12 +47,7 @@
__BEGIN_DECLS
extern int dspal_main(int argc, char *argv[]);
extern struct shmem_info *shmem_info_p;
__END_DECLS
extern int get_shmem_lock(const char *caller_file_name, int caller_line_number);
extern void release_shmem_lock(const char *caller_file_name,
int caller_line_number);
extern void init_shared_memory(void);
int px4muorb_orb_initialize()
{
+16
View File
@@ -33,6 +33,8 @@
#pragma once
#include <parameters/param.h>
#define MAX_SHMEM_PARAMS 2000 //MAP_SIZE - (LOCK_SIZE - sizeof(struct shmem_info))
#define PARAM_BUFFER_SIZE (MAX_SHMEM_PARAMS / 8 + 1)
@@ -64,3 +66,17 @@ struct shmem_info {
#define TYPE_MASK 0x1
extern bool handle_in_range(param_t);
#ifdef __PX4_QURT
extern struct shmem_info *shmem_info_p;
int get_shmem_lock(const char *caller_file_name, int caller_line_number);
void release_shmem_lock(const char *caller_file_name, int caller_line_number);
void init_shared_memory(void);
void copy_params_to_shmem(const param_info_s *param_info_base);
#endif
void update_to_shmem(param_t param, union param_value_u value);
int update_from_shmem(param_t param, union param_value_u *value);
void update_index_from_shmem(void);