40 Commits

Author SHA1 Message Date
Daniel Agar
274d0d65c6 lib/cdev/posix: increase max FDs 256->512 2022-01-28 17:30:53 -05:00
Jukka Laitinen
ce6147f570 uORB: Remove transfer of memory allocation ownership to CDev
- Allocate and free the node name in uORBDeviceNode.
- Add protected build support by de-allocating the name with kmm_free, when
  running in kernel side. strdup allocates from the kernel heap in NuttX kernel
  space.
- Remove the CDev::unregister_driver_and_memory(), it is no longer used

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-12-13 22:52:36 -05:00
Jukka Laitinen
25c10eb124 cdev: build & link fixes for NuttX protected build
- Always link to nuttx_fs for register/unregister_driver calls

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2021-12-13 22:52:36 -05:00
Oleg Evseev
f296a41737 cdev: fixes hardfaults when device get disconnected (#17846)
check if inode is not unlinked before use
2021-07-06 12:35:47 -04:00
Daniel Agar
a57b9f9381 delete drv_baro.h, drv_mag.h, drv_range_finder.h, drv_device.h and purge UAVCAN CDev usage 2021-01-12 22:04:52 -05:00
Daniel Agar
0f411d6820
Multi-EKF support (ekf2)
- ekf2 can now run in multi-instance mode (currently up to 9 instances)
    - in multi mode all estimates are published to alternate topics (eg estimator_attitude instead of vehicle_attitude)
 - new ekf2 selector runs in multi-instance mode to monitor and compare all instances, selecting a primary (eg N x estimator_attitude => vehicle_attitude)
 - sensors module accel & gyro inconsistency checks are now relative to the mean of all instances, rather than the current primary (when active ekf2 selector is responsible for choosing primary accel & gyro)
 - existing consumers of estimator_status must check estimator_selector_status to select current primary instance status
 - ekf2 single instance mode is still fully supported and the default

Co-authored-by: Paul Riseborough <gncsolns@gmail.com>
2020-10-27 10:56:11 -04:00
Daniel Agar
3345bf39b8 cdev: remove unnecessary virtuals and increase opt level
- poll, poll_notify, register_class_devname, unregister_class_devname aren't virtual
 - increase max optimization level on platforms that aren't flash constrained (MAX_CUSTOM_OPT_LEVEL)
2020-08-05 19:07:32 -04:00
Daniel Agar
b8b19f6166
cdev: posix remove std::map usage
- this is to make things a little easier for platforms like QuRT (voxl snapdragon) where there are libstdc++ complications
2020-07-21 10:17:55 -04:00
Daniel Agar
6dfe12d122
Revert "drivers/pwm_out: cleanup for multi-platform use" (#14812)
This reverts commit 0c8dcf94bc256801a45475cdd7bc6490e9fb8af7.
2020-05-02 23:42:51 -04:00
Daniel Agar
0c8dcf94bc drivers/pwm_out: cleanup for multi-platform use 2020-05-01 20:53:35 -04:00
Beat Küng
67f3234b5b posix cdev_platform: set errno on px4_open failure 2020-01-22 12:07:51 -05: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
Daniel Agar
c284198bec clang-tidy: partially fix hicpp-use-override 2019-10-28 10:50:31 -04:00
Daniel Agar
380cae18d1 clang-tidy: partially fix modernize-use-equals-default 2019-10-27 19:19:07 -04:00
Daniel Agar
279df3b1b8 clang-tidy: partially fix hicpp-use-equals-delete 2019-10-27 19:19:07 -04:00
Beat Küng
43fdcd7876 px4_middleware: remove that header and move px4::init to px4_init.h
delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
2019-08-30 07:59:44 +02:00
Julian Kent
d70b024ec7
GTest functional tests that include parameters and uORB messaging (#12521)
* Add kdevelop to gitignore

* Add test stubs

* Rename px4_add_gtest to px4_add_unit_gtest

* Add infrastructure to run functional tests

* Add example tests with parameters and uorb messages

* Fix memory issues in destructors in uORB manager and CDev

* Add a more real-world test of the collision prevention
2019-08-09 15:10:09 +02:00
Julian Oes
f3620f7018 Remove all leftover PX4_BACKTRACE calls 2019-06-05 08:16:19 +02:00
Julian Oes
7b9562e3b1 hysteresis: move out of systemlib, move to gtest
This moves the hysteresis test out of the systemlib and makes it its own
small library. Since it still depends on hrt_absolute_time this does not
link yet. My attempt to get all link dependencies together failed.
2019-05-27 09:57:50 +02:00
Beat Küng
011aef5464 px4_poll posix: fix wrap-around for large timeouts
timeout is an int, so it wraps when the poll timeout is >2147ms.
This happened in logger, resulting in poll never returning.
2019-05-17 07:53:33 -04:00
Daniel Agar
40e42a677b
NuttX cmake support optional compressed defconfigs 2019-01-30 10:54:53 -05:00
Daniel Agar
2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Beat Küng
beac53d775 cdev_platform: remove unused code (sim_delay) 2019-01-14 11:08:48 +01:00
Daniel Agar
c0b464e9e2 replace <cinttypes> with <inttypes.h>
- <cinttypes> isn't available in the NuttX c++ library
2019-01-06 19:20:57 -05:00
Julian Oes
14e5ebbbbc platforms: fix clock build for macOS (yet again) 2018-12-22 10:32:18 +01:00
Julian Oes
06c5037025 platforms: use CLOCK_MONOTONIC
For the non-lockstep case we want to use CLOCK_MONOTONIC if possible.
2018-12-22 10:32:18 +01:00
Julian Oes
876d4ebd76 posix: remove appalling errno hack 2018-12-22 10:32:18 +01:00
Julian Oes
66e7b4d578 posix: remove random lies 2018-12-22 10:32:18 +01:00
Julian Oes
e36e0b6ad0 posix: print warning before backtrace 2018-12-22 10:32:18 +01:00
Julian Oes
4ef0d74ea3 platforms: remove old lockstep functionality
These functions won't be used any longer with the new implementation.
2018-12-22 10:32:18 +01:00
Julian Oes
3e6e1f5c2b POSIX: use lockstep_scheduler to fake time
This integrates the lockstep_scheduler, so that the system time is set
by the mavlink HIL_SENSOR message.

This means that the speed factor is removed and the speed is entirely
given by the simulator.
2018-12-22 10:32:18 +01:00
Julian Oes
d70b0f1c8c Replace sleep with px4_sleep
This is another step to isolate time from the system.
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
c3448c19c4 make vcdevtest a generic cdev test 2018-11-26 14:40:14 -08:00
Daniel Agar
f692ad04d0 boards organization 2018-11-26 14:40:14 -08:00
Daniel Agar
023e267e9b uORB replace ORBMap with linked list 2018-11-23 08:15:48 +01:00
Daniel Agar
f1bf7172e7 make vdev file flags and priv consistent with nuttx 2018-11-23 08:15:48 +01:00
Daniel Agar
dbf2d25e2f uORB move to standalone CDev
- uORB topics should not be Devices with bus, address, device id
2018-08-27 13:14:15 -04:00
Daniel Agar
a2f4757e31 CDev extract from drivers Device class hierarchy
- leave CDev shim for now until all usage is updated
2018-08-27 13:14:15 -04:00