parameters lib convert to c++ (#10267)

This commit is contained in:
Daniel Agar
2018-09-04 09:18:28 -04:00
committed by GitHub
parent 0c08b7035b
commit 060463e8a7
20 changed files with 600 additions and 479 deletions

View File

@@ -43,10 +43,10 @@ else()
SOURCES
${PX4_BINARY_DIR}/apps.cpp
LINK_LIBS
modules__muorb__adsp
${module_libraries}
${df_driver_libs}
m
modules__muorb__adsp
)
add_custom_target(upload

View File

@@ -43,7 +43,7 @@ set(QURT_LAYER_SRCS
../../../posix/src/px4_layer/drv_hrt.c
qurt_stubs.c
main.cpp
shmem_qurt.c
shmem_qurt.cpp
)
if ("${QURT_ENABLE_STUBS}" STREQUAL "1")

View File

@@ -71,7 +71,6 @@ unsigned int sleep(unsigned int sec)
}
extern void hrt_init(void);
extern void init_params();
#if 0
void qurt_log(const char *fmt, ...)
@@ -108,9 +107,6 @@ void init_once(void)
hrt_work_queue_init();
hrt_init();
param_init();
/* Shared memory param sync*/
init_params();
}
void init(int argc, char *argv[], const char *app_name)

View File

@@ -56,11 +56,11 @@ unsigned char *map_base, *virt_addr;
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(struct param_info_s *);
void init_shared_memory();
void copy_params_to_shmem(param_info_s *);
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);
void update_index_from_shmem();
uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
static unsigned char krait_changed_index[MAX_SHMEM_PARAMS / 8 + 1];
@@ -136,7 +136,7 @@ void init_shared_memory(void)
}
//virt_addr = map_memory(MAP_ADDRESS);
map_base = calloc(MAP_SIZE, 1); //16KB
map_base = (unsigned char *)calloc(MAP_SIZE, 1); //16KB
if (map_base == NULL) {
PX4_INFO("adsp memory malloc failed\n");
@@ -153,10 +153,9 @@ void init_shared_memory(void)
}
PX4_INFO("adsp memory mapped\n");
}
void copy_params_to_shmem(struct param_info_s *param_info_base)
void copy_params_to_shmem(const param_info_s *param_info_base)
{
param_t param;
unsigned int i;
@@ -350,4 +349,3 @@ int update_from_shmem(param_t param, union param_value_u *value)
return retval;
}