47 Commits

Author SHA1 Message Date
Daniel Agar
674b92df18 parameters: sleep 10 ms before retrying a failed import/export 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
Daniel Agar
7560d45c61 parameters: import tolerate unhanlded BSON types 2021-12-06 09:37:08 -05:00
Daniel Agar
1af068179e parameters: tinybson print errors and count imported types 2021-12-06 09:37:08 -05:00
Jukka Laitinen
351f679c2f parameters: Use px4::atomic_bool instead of px4::atomic<bool>
This enables us to define the actual atomic bool type in px4_platform

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-10-13 15:01:26 -04:00
Beat Küng
540c024cbb parameters: avoid printing errors for erased flash devices
Errors:
ERROR [parameters] param import failed (-1) attempt 1, retrying
ERROR [parameters] param import failed (-1) attempt 2, retrying
ERROR [parameters] param import failed (-1) attempt 3, retrying
ERROR [parameters] param import failed (-1) attempt 4, retrying
ERROR [param] importing from '/fs/mtd_caldata' failed (-1)
2021-10-04 10:25:32 -04:00
Daniel Agar
99d7cf4255 parameters: only warn on invalid parameter import 2021-09-01 15:16:00 -04:00
Daniel Agar
65745a3676 purge broken qurt support and atlflight boards 2021-07-16 08:53:36 -04:00
David Sidrane
f50b238c78 lib/parameters:Use inttypes 2021-06-16 17:07:47 +02:00
Daniel Agar
e78a4287f9 parameters: attempt import multiple times 2021-05-02 13:48:16 -04:00
Daniel Agar
c266c3e43a parameters: remove unnecessary param_get_system_default_value() locking 2021-04-26 09:49:15 +02:00
Beat Küng
1730cd1971 param: avoid warning for 'param show -c' or 'param show -a' 2021-04-23 16:44:55 -04:00
Daniel Agar
f44f497e3f parameters: better handle export failures and retry 2021-04-12 21:26:50 -04:00
Daniel Agar
edc445a1b2 parameters: tinybson fill total document length for bson compatibility 2021-04-12 21:26:50 -04:00
Beat Küng
b512a3d8f7 param: add param_get_system_default_value 2021-03-12 13:44:10 +01:00
Daniel Agar
7d78cf8505 parameters: param_value_is_default() add note about params_changed bitset usage 2021-03-11 11:30:43 -05:00
Daniel Agar
a991e78e18 parameters: fix runtime default edge case 2021-03-11 11:30:43 -05:00
Daniel Agar
684424bf73 parameters: delete unused BSON_BINDATA handling 2021-03-09 19:29:42 -05:00
Daniel Agar
711a69854b uthash: move remaining utarray usage to parameters and delete unused
- this is to discourage further use until utarray can be dropped entirely
2021-02-20 11:28:22 +01:00
Daniel Agar
ce64951578 parameter_update.msg: add basic status info 2021-02-12 08:27:47 -05:00
Daniel Agar
b8b13bb882 parameters runtime defaults 2021-02-12 08:27:47 -05:00
Daniel Agar
da1a38b44e parameters: merge generated files ito single static constexpr header
- store parameter type and if volatile separately (saves kilobytes of flash)
 - use Bitset for tracking active and changed parameters
 - use atomic for autosave_enabled flag
 - compile at ${MAX_CUSTOM_OPT_LEVEL} (-O2 on non flash constrained boards)
2021-02-12 08:27:47 -05:00
Daniel Agar
1b9d68abd5 parameters: add new param_get_default_value() 2021-01-27 13:11:41 -05:00
Daniel Agar
a152fb65cb
parameters: remove unnecessary duplicated shutdown lock in param_save_default()
- param_export already takes the shutdown lock
2020-12-16 10:50:05 -05:00
Daniel Agar
378c0b5093 parameters: find and get perf counters aren't threadsafe 2020-12-02 10:11:42 -05:00
Daniel Agar
e69aea0a9b parameters: don't keep in memory if set to default 2020-12-02 10:11:42 -05:00
Daniel Agar
7255f5feac parameters: add param_reset_no_notification()
- add reset() to Param<>
2020-10-15 08:32:05 +02: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
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
Daniel Agar
9963bb6c40 parameters: lock shutdown earlier in param_save_default()
- this ensures the parameter file is closed properly before shutdown
2020-05-06 13:53:54 -04:00
rfu
8787780de4 some printf format and conversion fixes 2020-05-04 09:49:23 +02:00
Beat Küng
dfb5b5d7d9
fix param import transition
* fix param import transition for MC_DTERM_CUTOFF

The previous implementation did not work, as there was a check for
param_find_no_notification() returning PARAM_INVALID for IMU_DGYRO_CUTOFF,
and therefore would not call param_modify_on_import().

This moves param_modify_on_import() before the check and makes it modify
the bson node directly.

* parameters: fix param import transition when testing is enabled

BUILD_TESTING is used for unit test builds, PX4_TESTING is used to enable additional test material within PX4

Co-authored-by: Daniel Agar <daniel@agar.ca>
2020-04-02 18:41:00 -04:00
Beat Küng
a2b2605443 param: fix param_get_cplusplus type check 2020-03-10 10:11:43 -04:00
Beat Küng
b54e5a1c23 param: automatically update calibration ID params on import
This avoids the need for recalibration, and also cleans up other driver
ID's (merge separate accel/gyro).

The SPI address was previously set to a board-specific (arbitrary) value,
and is now set to 0. This will allow extending for multiple sensors of the
same type on the same bus.
2020-03-10 10:11:43 -04:00
Daniel Agar
d7c3e1066a
uavcannode updates and px4_fmu-v4_cannode example
- drivers/uavcannode add baro, mag, gps publications
 - delete old px4_cannode-v1 board
 - add stripped down simple rcS for CAN nodes
2020-02-16 12:11:54 -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
Daniel Agar
967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Beat Küng
82106105b7 parameters: defer auto-saving to after disarming for flash-based params
This is especially important for DShot, that does not update when the CPU
stalls.
2019-10-11 08:14:17 +02:00
Beat Küng
93a12436a3 parameters: update perf counter for flash-based param_save_default() 2019-10-11 08:14:17 +02:00
Daniel Agar
658d734068 param add status 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
Julian Oes
8e4296d000 parameters: remove unneeded usleep
According to @bkueng this was to schedule other processes but can now be
removed.
2018-12-22 10:32:18 +01:00
Julian Oes
3f508c99fd parameters: commented out strange usleep 2018-12-22 10:32:18 +01:00
Julian Oes
5b9dea5604 Replacing usleep with px4_usleep
This is a step towards isolating time from the system.
2018-12-22 10:32:18 +01:00
Daniel Agar
060463e8a7
parameters lib convert to c++ (#10267) 2018-09-04 09:18:28 -04:00