mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 23:33:35 +08:00
Final parameter interface cleanup - removed last bit of old cruft, fixed a bug on parameter update notification, cleaned up API slightly in naming
This commit is contained in:
@@ -39,7 +39,8 @@ CSRCS = err.c \
|
||||
hx_stream.c \
|
||||
perf_counter.c \
|
||||
param/param.c \
|
||||
bson/tinybson.c
|
||||
bson/tinybson.c \
|
||||
conversions.c
|
||||
|
||||
#
|
||||
# XXX this really should be a CONFIG_* test
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include "systemlib/bson/tinybson.h"
|
||||
|
||||
#include "uORB/uORB.h"
|
||||
#include "uORB/topics/parameters.h"
|
||||
#include "uORB/topics/parameter_update.h"
|
||||
|
||||
#if 1
|
||||
# define debug(fmt, args...) do { warnx(fmt, ##args); } while(0)
|
||||
@@ -318,6 +318,7 @@ int
|
||||
param_set(param_t param, const void *val)
|
||||
{
|
||||
int result = -1;
|
||||
bool params_changed = false;
|
||||
|
||||
param_lock();
|
||||
|
||||
@@ -378,7 +379,7 @@ param_set(param_t param, const void *val)
|
||||
}
|
||||
|
||||
s->unsaved = true;
|
||||
|
||||
params_changed = true;
|
||||
result = 0;
|
||||
}
|
||||
|
||||
@@ -389,7 +390,7 @@ out:
|
||||
* If we set something, now that we have unlocked, go ahead and advertise that
|
||||
* a thing has been set.
|
||||
*/
|
||||
if (result != 0) {
|
||||
if (params_changed) {
|
||||
struct parameter_update_s pup = { .timestamp = hrt_absolute_time() };
|
||||
|
||||
/*
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Copyright (C) 2012 PX4 Development Team. All rights reserved.
|
||||
* Author: @author Lorenz Meier <lm@inf.ethz.ch>
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
@@ -35,7 +34,7 @@
|
||||
|
||||
/**
|
||||
* @file systemlib.c
|
||||
* Implementation of commonly used low-level system-call like functions
|
||||
* Implementation of commonly used low-level system-call like functions.
|
||||
*/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
@@ -47,7 +46,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <arch/board/drv_eeprom.h>
|
||||
#include <uORB/parameter_storage.h>
|
||||
#include <float.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
/**
|
||||
* @file systemlib.h
|
||||
* Definition of commonly used low-level system-call like functions
|
||||
* Definition of commonly used low-level system-call like functions.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEMLIB_H_
|
||||
|
||||
Reference in New Issue
Block a user