mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 22:13:34 +08:00
Running fix_code_style.sh on the requested source files.
This commit is contained in:
@@ -60,8 +60,7 @@ void update_index_from_shmem(void);
|
||||
uint64_t update_from_shmem_prev_time = 0, update_from_shmem_current_time = 0;
|
||||
extern unsigned char *adsp_changed_index;
|
||||
|
||||
struct param_wbuf_s
|
||||
{
|
||||
struct param_wbuf_s {
|
||||
param_t param;
|
||||
union param_value_u val;
|
||||
bool unsaved;
|
||||
@@ -70,9 +69,10 @@ struct param_wbuf_s
|
||||
/*update value and param's change bit in shared memory*/
|
||||
void update_to_shmem(param_t param, union param_value_u value)
|
||||
{
|
||||
if (px4muorb_param_update_to_shmem(param, (unsigned char*) &value,
|
||||
sizeof(value)))
|
||||
if (px4muorb_param_update_to_shmem(param, (unsigned char *) &value,
|
||||
sizeof(value))) {
|
||||
PX4_ERR("krait update param %u failed", param);
|
||||
}
|
||||
}
|
||||
|
||||
void update_index_from_shmem(void)
|
||||
@@ -83,14 +83,15 @@ void update_index_from_shmem(void)
|
||||
}
|
||||
|
||||
px4muorb_param_update_index_from_shmem(adsp_changed_index,
|
||||
PARAM_BUFFER_SIZE);
|
||||
PARAM_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
static void update_value_from_shmem(param_t param, union param_value_u *value)
|
||||
{
|
||||
if (px4muorb_param_update_value_from_shmem(param, (unsigned char*) value,
|
||||
sizeof(union param_value_u)))
|
||||
if (px4muorb_param_update_value_from_shmem(param, (unsigned char *) value,
|
||||
sizeof(union param_value_u))) {
|
||||
PX4_ERR("%s get param failed", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
int update_from_shmem(param_t param, union param_value_u *value)
|
||||
@@ -106,7 +107,7 @@ int update_from_shmem(param_t param, union param_value_u *value)
|
||||
update_from_shmem_current_time = hrt_absolute_time();
|
||||
|
||||
if ((update_from_shmem_current_time - update_from_shmem_prev_time)
|
||||
> 1000000) { //update every 1 second
|
||||
> 1000000) { //update every 1 second
|
||||
update_from_shmem_prev_time = update_from_shmem_current_time;
|
||||
update_index_from_shmem();
|
||||
}
|
||||
@@ -123,7 +124,7 @@ int update_from_shmem(param_t param, union param_value_u *value)
|
||||
//else {PX4_INFO("no change to param %s", param_name(param));}
|
||||
|
||||
PX4_DEBUG("%s %d bit on adsp index[%d]",
|
||||
(retval) ? "cleared" : "unchanged", bit_changed, byte_changed);
|
||||
(retval) ? "cleared" : "unchanged", bit_changed, byte_changed);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user