110 Commits

Author SHA1 Message Date
Daniel Agar
9cbb5c9920 parameters: fix export shutdown locking
- in NuttX bchlib keeps a sector sized buffer that might not be written
out to RAMTRON until the file is closed
2022-01-02 10:46:34 -05:00
Daniel Agar
20d3e6f4e1 parameters: add simple BSON verification pass after export 2021-12-27 09:17:00 -05:00
Daniel Agar
3f3836afa8 parameters: simplify import mark_unsaved and don't fail bson decode unnecessarily 2021-12-24 14:32:40 -05:00
Daniel Agar
38731662c6 parameters use bitset for mark_unsaved 2021-12-24 14:32:40 -05:00
Daniel Agar
1f6acd0171 parameters: add simple backup and restore mechanism 2021-12-06 09:37:08 -05:00
Daniel Agar
7bfebf5289 parameters: add param dump to read and decode bson to console 2021-12-06 09:37:08 -05:00
Peter van der Perk
d5e3e9a7bc [Kconfig] Decompose Kconfig, now each module has its own Kconfig
Which is better for versioning and decomposability
2021-10-07 10:09:01 -04:00
Daniel Agar
5dfc07cb1b systemcmds/param: add set-default sient (-s) option 2021-09-01 15:16:00 -04:00
David Sidrane
1b80018f30 systemcmds:Use inttypes 2021-06-16 17:07:47 +02:00
Beat Küng
51f527d845 param: update 'param show-for-airframe' to use set-default 2021-04-23 16:44:55 -04:00
Lorenz Meier
21f5f9fba0 Param: Print failing param name
This is important for any sort of boot logs to know which parameter failed.
2021-03-17 22:03:18 +01:00
Beat Küng
9ceef80e06 param: remove set-default print's during bootup 2021-03-12 13:44:10 +01:00
Daniel Agar
b8b13bb882 parameters runtime defaults 2021-02-12 08:27:47 -05:00
Lorenz Meier
13e875645c Revert "systemcmds/param: use PX4_INFO_RAW directly (delete qurt special case)"
This reverts commit 470f24037e489a2496f98ac77d1b71d36993b08b.
2021-02-02 00:53:45 +01:00
Daniel Agar
470f24037e systemcmds/param: use PX4_INFO_RAW directly (delete qurt special case) 2021-01-31 11:43:47 +01:00
Beat Küng
3e9692c5bd param_import: add mark_saved argument
Behavior of the 'param import' command:
- if no file provided, parameters are marked as saved (differs from before)
- if a file is provided: parameters are not marked as saved
2020-10-12 15:22:26 +02:00
Beat Küng
f6e8ddfaa0 param_export: add optional filter method 2020-10-12 15:22:26 +02:00
Beat Küng
f106e6b266 param: add 'param show-for-airframe' command
- simplifies creation of an airframe config
- could be done from QGC, but it only knows if a param is non-default from
  metadata, which can be incorrect/missing information
- for the list of exceptions we could look at '@category', but we don't have
  that info in the build
- there might be some more exceptions to be added
2020-09-18 09:03:29 +02:00
Matthias Grob
c6e2722b8f param: remove reset_nostart
Since we have reset_excludes and SYS_AUTOSTART and SYS_AUTOCONFIG
can be excluded like every other parameter.
2020-09-08 12:03:41 +02:00
Matthias Grob
ce9954a919 param: enable reseting specific parameters from shell
Renaming previous "param reset" to "param reset_all".
2020-09-08 12:03:41 +02:00
Daniel Agar
0e64baa93b parameters: delete unused PARAM_TYPE_STRUCT 2020-08-25 09:59:29 -04:00
Beat Küng
0c4fd2bfa0 param: also show unused params for 'param show -c'
I find this generally useful for debugging.
2020-06-29 09:49:56 -04:00
Daniel Agar
de4f594937 DriverFramework purge
The bulk of this change was tightly coupled and needed to be deleted in one pass. Some of the smaller changes were things that broke as a result of the initial purge and subsequently fixed by further eradicating unnecessary platform differences. Finally, I deleted any dead code I came across in the related files I touched while going through everything.

 - DriverFramework (src/lib/DriverFramework submodule) completely removed
 - added dspal submodule in qurt platform (was brought in via DriverFramework)
 - all df wrapper drivers removed
 - all boards using df wrapper drivers updated to use in tree equivalents
 - unused empty arch/board.h on posix and qurt removed
 - unused IOCTLs removed (pub block, priv, etc)
 - Integrator delete methods only used from df wrapper drivers
 - commander: sensor calibration use "NuttX version" everywhere for now
 - sensors: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - battery_status: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
 - cdev cleanup conflicting typedefs and names with actual OS (pollevent_t, etc)
 - load_mon and top remove from linux boards (unused)
 - delete unused PX4_MAIN_FUNCTION
 - delete unused getreg32 macro
 - delete unused SIOCDEVPRIVATE define
 - named each platform tasks consistently
 - posix list_devices and list_topics removed (list_files now shows all virtual files)
2020-01-13 14:07:03 -05:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
BazookaJoe1900
02e861b16e enable silent compare of parameter (#12850)
Remove false errors after comparing parameters that doesn't exists.
as described in #12832
2019-10-07 09:50:11 +02:00
Daniel Agar
78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Beat Küng
b71bae414b param: fix potential nullptr dereferencing on param import
NuttX 7.28 seemed to handle this gracefully, but officially passing NULL
results in undefined behavior, and with 7.29 leads to a hardfault.

This happens on configs with flash-based params, on the first unsuccessful
import attempt.
2019-07-19 09:55:08 +02:00
Beat Küng
5c715978e8 param compare/greater: do not print 'parameter not found' message
Reduces clutter in the boot output (now that we have it in the log).
On omnibus for example we see:
ERROR [param] Parameter SENS_EN_BATT not found
ERROR [param] Parameter SENS_EN_LL40LS not found
ERROR [param] Parameter SENS_EN_LL40LS not found
ERROR [param] Parameter SENS_EN_MB12XX not found
ERROR [param] Parameter SENS_EN_PGA460 not found
ERROR [param] Parameter SENS_EN_SF1XX not found
ERROR [param] Parameter SENS_EN_TRANGER not found
2019-06-06 09:16:49 -04:00
Daniel Agar
658d734068 param add status 2019-01-18 11:50:37 -05:00
Daniel Agar
84724d5e1d param show default only active parameters
- add -a option to display all possible system parameters
2019-01-18 11:50:37 -05:00
Beat Küng
5b4a77a67b params: add possibility to access files if flash-based params are enabled
- the flash-backend is selected by specifying nullptr as file or -1 as fd
- the default file is nullptr, and thus the FLASH
- 'param select' has no effect, FLASH is always the default

Thus there should be no functional change to existing setups.
2018-12-23 15:49:37 -05:00
Beat Küng
15044909a4 param: add 'param touch <param_name>' command
so that params can be marked as used from scripts.
2018-09-25 07:53:29 +02:00
Beat Küng
9a259cd139 param: use PX4_INFO_RAW and add 'param show -q <param_name' command 2018-08-13 21:50:14 -04:00
Daniel Agar
d73d20bcce systemlib delete unused systemlib.h 2018-06-12 09:06:30 +02: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
37ff267b68 param.cpp: fix issues by clang tidy (nullptr & void) 2017-07-14 11:57:11 +02:00
Beat Küng
d309617998 param.c: rename to cpp and add module documentation
use c++ so that raw string literals can be used
2017-07-14 11:57:11 +02:00
Beat Küng
7b7836de05 param command: update usage 2017-07-14 11:57:11 +02:00
Daniel Agar
94f5df8611 param and pwm ignore -Warray-bounds for clang 2017-06-02 19:35:18 -04:00
Beat Küng
f256d03364 param command: remove param_save_default() calls
Not needed anymore due to autosave
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
Beat Küng
b4290b6b52 params: make param_t uint16_t on NuttX
param_t is only used as an offset and we have <1000 params, so an uint16_t
is enough.
This saves roughly 1KB of RAM. We only do that on NuttX because normal
integers have better performance in general.
Previously on amd64, this was even 64bits because it was an uintptr_t.
2017-03-14 21:30:53 +01:00
Beat Küng
3cc1c9d0a9 param command: warnx -> PX4_{WARN,ERR} 2017-02-25 11:02:15 +01:00
Beat Küng
a0f00f84f3 param show command: add -c to show only changed, do case insensitive comparison 2017-02-17 11:27:08 +01:00
Beat Küng
42967df63f param command: use param_* calls even if flash-based params are enabled
This will ensure proper locking.
2017-02-17 11:27:08 +01:00
Lorenz Meier
cf5f5bfad9 Fix code style for param 2017-01-12 10:57:11 -08:00
Mark Charlebois
b14959e165 Fixed param output for QuRT
QuRT doesn't support printf, so the messages don't appeat in mini-dm.

This problem is also present in many other parts of the PX4 code.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2017-01-12 10:57:11 -08:00
Stephan Brown
5a6084de07 param: Add a missing include. 2017-01-06 09:58:58 +01:00
Stephan Brown
e57f6221b2 Rearrange parameter unit tests so they are in alphabetical order. 2017-01-06 09:58:58 +01:00
Stephan Brown
67a484ac34 Make parameter generation also depend on the scripts that run. Address some review comments. 2017-01-06 09:58:58 +01:00