170 Commits

Author SHA1 Message Date
Beat Küng
a2ebbe9066 pwm_limit: rename to output_limit
As there is nothing pwm-specific about it.
2019-08-31 10:05:00 -04:00
Daniel Agar
ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Beat Küng
f7ee3c2015 cmake configs: add vtol_att_control for required parameters VT_B_DEC_MSS & VT_B_REV_DEL
Required by Navigator.
2018-03-13 17:35:15 +01:00
Beat Küng
fca99cf775 param: refactor BlockParam classes
- make the selected parameter a template argument. This
  enables type-checking at compile-time.
- move things to src/platforms.
  This provides consistent includes with ModuleBase
- add ModuleParams base class (replaces Block & SuperBlock)
- drop the Block* prefix from the class names
2018-03-13 17:35:15 +01:00
Beat Küng
0e4034d01e param: add a px4_parameters_public.h.jinja template
Generates an enum with all params & additional type information for static
type checking

The generated public param header is required to build the modules using
the new BlockParam classes.
2018-03-13 17:35:15 +01:00
Roman
10bf6a4b59 params cmd: be less verbose
Signed-off-by: Roman <bapstroman@gmail.com>
2018-02-22 15:10:22 -05:00
Daniel Agar
e04d30c9cf param markdown metadata handle float enums 2018-02-10 20:37:47 -05:00
Daniel Agar
f73f95965a parameter culling include subdirectories of modules 2018-02-04 18:15:57 +01:00
Daniel Agar
4c5b42f256 parameters move bson buffered file support into tinybson 2018-01-30 09:17:56 -05:00
Daniel Agar
a25ca0c37d param include px4_config.h for FLASH_BASED_PARAMS
- fixes #8585
2018-01-12 23:46:15 +01:00
Beat Küng
f561d16334 fix param_export: off-by-one buffer size
In rare circumstances, the buffer size was too small by 1 byte, leading
to a param export failure. And leading to a reset of all params!
This could only happen when the last saved param was a float.

Also the realloc_ok initialization is not needed.
2018-01-10 22:03:14 +01:00
Beat Küng
f8ceee0cf2 fix param: need to use fsync() and not px4_fsync()
It's used with real OS FD's.
2018-01-10 22:03:14 +01:00
Beat Küng
f962e9826b param_export: reduce bson buffer size from 512 to 256
Some modules call this (and maybe in rare circumstances), which could lead
to stack overflows. With our current headroom of >= 300bytes, 256 should
be ok.

This increases the export time from ~28ms to ~34ms in my case (on a
Pixracer)
2018-01-10 22:03:14 +01:00
Lorenz Meier
3d9cd5c0bc Params: Ignore volatile 2018-01-08 17:01:02 +01:00
Lorenz Meier
7f12f4ae9b Params: Switch level to category and move it to attribute along with volatile
This makes it easier for QGC to parse.
2018-01-08 09:27:22 +01:00
Lorenz Meier
55e0588661 Eagle: Update to latest param message 2018-01-08 09:27:22 +01:00
Lorenz Meier
ac5f856d2d Param parser and XML output: Add support for volatile attribute
This allows to mark parameters as volatile.
2018-01-08 09:27:22 +01:00
Lorenz Meier
7695f79239 Parameters: Add support for volatile parameters
Volatile parameters are ones that do not represent a fundamental configuration change but rather than incrementally changing settings. These include logged flight hours or sensor offsets. Marking them as volatile avoids these parameters forcing time-consuming telemetry updates.
2018-01-08 09:27:22 +01:00
Lorenz Meier
fb3c58d85f Param interface: Publish instance count
This helps subscribers to understand if they should update their parameters or not. We will extend this with other flags such as the current save status and alike.
2018-01-08 09:27:22 +01:00
Lorenz Meier
bf48a35882 Systemlib: Introduce volatile and level tags for parameters 2018-01-08 09:27:22 +01:00
Daniel Agar
430cdada60 param_export use bson encoder buffer 2018-01-04 09:21:17 +01:00
Daniel Agar
08443c0bfc params add param_find perf counter 2018-01-04 09:21:17 +01:00
Daniel Agar
641129ad4e param add perf counters 2018-01-04 09:21:17 +01:00
Hamish Willee
6bb3e65d23 Make non-wrapping/scrolling table 2017-12-03 14:10:50 +00:00
Hamish Willee
c551496a41 Stop parameter names from wrapping in markdown table 2017-12-03 14:10:50 +00:00
Daniel Agar
85a7a0a86a parameters.xml sort parameters by name, sort enums by value 2017-11-22 13:42:54 -05:00
Daniel Agar
fc80846825 simplify param scoping and centralize dependencies 2017-11-22 10:36:51 +01:00
Beat Küng
8a693fa13d param: undefine CHECK_PARAM_TYPE after it's used 2017-10-27 10:43:15 +02:00
Beat Küng
c35b0aa270 param: redefine type-safe versions for param_get() when used in C++ code 2017-10-27 10:43:15 +02:00
Daniel Agar
2113772443 improve nuttx verbose build 2017-09-29 10:13:51 -04:00
Daniel Agar
545ce9ae24 modules remove extra semicolons 2017-09-16 21:29:52 +01:00
Beat Küng
19e7ba63ee param: use separate param save lock
param save is an expensive operation that can take several 100ms. And
previously it was possible that a param_get() caller was blocked on a
save operation. If this happened due to a param change notification,
important modules, such as sensors, could have been blocked for a longer
period (and affecting the flight performance).
With this patch, this situation is not possible anymore, because a param
save now uses the reader lock and a separate file lock.

However it is still possible that a param_set() needs to wait for a save
operation, thus blocking for a longer time. param_set() thus needs to be
avoided in important modules when the system is armed.
In the case of mavlink it works, since it does not affect the flight if
the mavlink receiver is blocked over a longer time. It is only problematic
if a joystick is used as input or in offboard control.
2017-09-12 08:46:10 +02:00
Daniel Agar
9b5fe8c476 ignore -Wsign-compare per module 2017-09-07 10:27:36 +02:00
Beat Küng
8923664f30 param: seek to the beginning of the file before re-trying a failed export attempt 2017-07-29 23:10:47 +02:00
Beat Küng
931ef189b5 param: grab the shutdown lock while writing params to the file 2017-07-29 23:10:47 +02:00
Beat Küng
7fc20049e0 param_shmem import: don't fail on type mismatch 2017-07-20 18:49:38 +02:00
Beat Küng
2340e7073d param import: don't fail on type mismatch
This can happen for example when a param type is changed from int32 to
float. The type check will then fail if the param is stored and the param
import will be aborted.
Now we just skip the entry and continue loading the rest.
2017-07-20 18:49:38 +02:00
Daniel Agar
8b3fb1e999 param fix parameters.xml dependency 2017-06-19 20:24:09 +02:00
Daniel Agar
bd60f87283 move param jinja templates into relevant module 2017-06-12 12:18:53 -04:00
Daniel Agar
4937449890 move parameter unittest into systemcmds 2017-06-12 12:18:53 -04:00
Daniel Agar
f26cd01d16 param gen reorganize and fix DISABLE_PARAMS_MODULE_SCOPING 2017-06-12 12:18:53 -04:00
Daniel Agar
768faa1ae3 clang-tidy param avoid malloc(0) 2017-06-02 19:35:18 -04:00
David Sidrane
6aadc75d18 Removed interrupt based locking on FMUv4 HW
The ramtron driver already calls SPI_LOCK when accessing the
  FRAM.

  Removed the interrupt lockout and anabled the SPI_LOCK
  in the ms5611 driver on any HW where the
  PX4_SPI_BUS_BARO == PX4_SPI_BUS_RAMTRON
2017-05-03 08:17:12 +02:00
Beat Küng
694bf48422 system: add generic shutdown API 2017-04-20 10:01:51 +02:00
jwilson
57fa031e2b Fixes problem preventing params on snapdragon platforms from being saved to flash memory. 2017-04-20 09:06:13 +02:00
Beat Küng
044a767235 param: add PARAM_NO_AUTOSAVE: if defined, do not depend on LP work queue
Some NuttX configs do not have the work queues enabled.
2017-04-06 11:49:03 +02:00
Beat Küng
dffba3e03b param: move variable definitions to the top of the file 2017-04-06 11:49:03 +02:00
Beat Küng
a0e2b0c5a2 param: add param_control_autosave to enable/disable autosave 2017-04-06 11:49:03 +02:00
Beat Küng
f3e9739ab0 param export: use writer lock
to protect against concurrent writes to the same file
2017-04-06 11:49:03 +02:00
Beat Küng
a5cdff06d5 param: implement rate-limited autosave
- add a saving delay of 300ms
- save at most once every 2 seconds
2017-04-06 11:49:03 +02:00