Commit Graph

226 Commits

Author SHA1 Message Date
Amir Melzer a8787e8fe3 Add a driver for the Analog Devices ADIS16448 IMU (#8301) 2017-11-26 14:52:22 -05:00
Daniel Agar 00a47ba542 drivers device I2C consistency between nuttx/posix 2017-11-20 23:44:31 +01:00
Daniel Agar 8738fe8daf drivers device naming consistency 2017-11-20 23:44:31 +01:00
Daniel Agar 53595bac0e board support add px4_i2c_bus_external/px4_spi_bus_external 2017-11-20 23:44:31 +01:00
Daniel Agar 2aeb4aa55f drivers device move locking to cdev 2017-11-20 23:44:31 +01:00
Daniel Agar bf435fc520 drivers device merge nuttx and posix Device and CDev 2017-11-20 23:44:31 +01:00
Daniel Agar c6b6164cf7 drivers device nuttx remove unused interrupt support 2017-11-20 23:44:31 +01:00
Daniel Agar 5d20cf6b57 drivers device organize by nuttx/posix 2017-11-20 23:44:31 +01:00
Beat Küng d096ec0b61 vdev_posix: change filemap into a static list of objects instead of pointers
to avoid dynamic memory allocations & frees (specifically in orb_exists)
2017-10-18 08:40:32 +02:00
Beat Küng 2668055358 vdev: remove unused fileds from file_t 2017-10-18 08:40:32 +02:00
Sugnan Prabhu 81809be7cd Add include guard in headers files (#8108)
Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com>
2017-10-11 09:47:52 -04:00
Daniel Agar 01b3e6fd25 NuttX upgrade cmake wrapper (#7873)
* NuttX cmake

* px4_macros:Pass the stringified predicate as second arg to static assert

   CC_ASSERT mapes to the c++ static_assert or provides the same
   funtionality for c via the other macros. The c++ static assert
   takes 2 argumants the prdicate and a message. This fixes the
   lacking second argument.

* Updated nuttx and apps submodule to upstream nuttx 7.21+==master

   This is the latest uptake of upstream nuttx and apps.

* ROMFS generate with xxd instead of objcopy

* delete nuttx-patches

* NuttX update submodules to latest px4_nuttx-master

* fix nuttx apps and board dependency

* docker_run update to latest container 2017-08-29

* cmake ROMFS portable sed usage

* NuttX update submodules to latest px4_nuttx-master
2017-09-29 10:13:51 -04:00
David Sidrane c7823ffc58 spi:Print only device index (mask bus in _device
Print only the PX4_SPI_DEV_ID portion of the _device
2017-09-29 10:13:51 -04:00
David Sidrane fa0ae6386d device:spi_dev_e is now uint32_t in NuttX
Using new type of uint32_t for spi device
2017-09-29 10:13:51 -04:00
David Sidrane 21caf63e13 Update px4iofirmware, px4io and drivers to uses NuttX IRQ API changes 2017-09-29 10:13:51 -04:00
David Sidrane e93a5002a1 Updated Micro HAL for kinetis
Added px4_ abstraction macros
 Removed stm32.h reference
2017-09-29 10:13:51 -04:00
Daniel Agar 58268c832c drivers remove extra semicolons 2017-09-16 21:29:52 +01:00
Daniel Agar 79869c848f drivers fix missing field initializers 2017-09-16 21:29:52 +01:00
Eric Wang 2b714e079b driver: vdev_posix, increase PX4_MAX_FD (#7905)
- avoid "exceeded maximum number of file descriptors" when "make posix gazebo_typhoon_h480"
 - closes #7892
2017-09-03 11:55:44 -04:00
Daniel Agar 07619cf723 Make NuttX drivers cross platform (VDev -> CDev) 2017-08-31 09:27:36 +02:00
Beat Küng 5f5dca4804 vdev: replace static list with an std::map
VDev::getDev() is used in px4_access, which is used in orb_exists. And if
the topic does not exist, it iterates over all 500 indexes, which is slow.
It was slow even if the topic existed, the map reduces runtime from linear
to logarithmic (there are around 80 items in the container).
This is only used on posix.
2017-08-23 08:10:16 +02:00
Beat Küng 7a409cf843 vdev: remove unneeded devList & topicList methods 2017-08-23 08:10:16 +02:00
Daniel Agar b70b8288b9 px4_includes cleanup incomplete list 2017-08-20 20:42:42 +02:00
David Sidrane 64aaec4419 i2c_nuttx:Use BOARD_NUMBER_I2C_BUSES and BOARD_I2C_BUS_CLOCK_INIT
Used the board overrideable vlaues to define the _bus_clocks
   array and initalize it.
2017-08-08 21:45:01 +02:00
Beat Küng eeb1895922 i2c_posix: fix simulate variable cannot be assigned on QuRT 2017-07-13 16:53:28 +02:00
Beat Küng bf11362dae i2c_posix: fix use of wrong device path
previously, get_devname() was used as the I2C device path, but on NuttX,
get_devname() is the device file which the driver creates. This patch
changes it, so the sematics are the same as on NuttX: both now use _bus
to decide to which I2C bus device to talk to.

I did not see any other use-cases than the led on ocpoc.
2017-07-13 16:53:28 +02:00
Nicolae Rosia 2092770361 Integrator: fix comparison
Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
2017-07-06 08:48:44 +02:00
Daniel Agar 40d40330b8 delete unused pio 2017-06-29 03:23:39 -10:00
Daniel Agar 4937449890 move parameter unittest into systemcmds 2017-06-12 12:18:53 -04:00
Phillip Khandeliants 5012dffeae Potentially infinite and deleted loops found by PVS-Studio (#7100)
- Fixed V712
 - The compiler can optimize this code by creating an infinite loop, or simply deleting it.
 - There is need to add a volatile qualifier to the '_ExitFlag' and 'sim_delay' variables.
2017-04-21 11:13:06 -04:00
Beat Küng 0165633bf3 board_config: remove px4_board_pwr, use px4_shutdown_request instead
px4_board_pwr has become obsolete with the addition of board_shutdown
2017-04-20 10:01:51 +02:00
James Goppert 7659402fdb WIP: valgrind runtime analysis and fixes (#6521)
* Fix several valgrind identified mem leaks

* Added callgrind target.

* px4_posix_tasks use nullptr
2017-02-17 12:36:52 -05:00
Lorenz Meier 6bd29b24f6 POSIX: Avoid missing prototype warning on some POSIX platforms 2017-02-04 21:06:21 +01:00
Daniel Agar 6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Daniel Agar e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
Lorenz Meier a520c62d1a Allow setting the device ID in device driver 2017-01-29 16:24:47 +01:00
Lorenz Meier 33f6316d3c Device: Also allow to read bus type 2017-01-29 16:24:47 +01:00
Daniel Agar 8fbf5cbdaf astyle src/drivers/device 2017-01-29 01:18:32 +01:00
Daniel Agar 751909cd4e clang readability-braces-around-statements (#6298) 2017-01-11 17:01:51 -05:00
David Sidrane c9f10107c0 Nuttx Upgrade:Adds sem_setprotocol 2016-12-21 08:34:21 +01:00
David Sidrane dcc2d1c3d1 I2C changes for upstream NuttX per trasaction freq control 2016-12-21 08:34:20 +01:00
David Sidrane fd7d399958 Upstream Nuttx restructured directories use micro_hal 2016-12-21 08:34:20 +01:00
Michael Schaeuble bdb76d013e Fix incorrect MPU9250 device ID
We propagate the bus parameters from the bus interface to the sensor
devices. Thus, the device ID of the sensor driver is set to the correct
bus id and address. Otherwise it would be zero, which is an issue if several MPU9250s
are running at the same time.
2016-12-09 18:59:42 +01:00
Beat Küng dc6ca7c372 VDev & CDev: dynamically allocate & resize _pollset array
In most cases, really only 1 element is needed. The dynamic allocation
handles cases where more are necessary. This is all done within a locked
state, so no races can occur.

Frees roughly 2.3KB RAM.
2016-11-14 10:27:57 +01:00
Beat Küng 9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00
Beat Küng 03c12c4c78 Device: use uint16_t for _open_count instead of int (save space) 2016-10-23 15:25:20 +02:00
Beat Küng a5e6f3213f Device: remove _irq_attached flag, test with _irq == 0 instead 2016-10-23 15:25:20 +02:00
Lorenz Meier 45f740e210 Device: Allow access to device id 2016-09-04 19:11:28 +02:00
Beat Küng e2afb0be6b px4_log.h: remove hrt_absolute_time() declaration (it does not belong here) 2016-08-24 21:24:35 +02:00
Lorenz Meier 7398164fcc Updated PX4 use / API of low level GPIO and other hardware-centric system facilities 2016-05-28 14:56:17 +02:00