Commit Graph

64 Commits

Author SHA1 Message Date
Julian Oes 00a7ac013c ak09916: fix mag spikes
This fixes spuriously occuring mag spikes in the external mag of Here2.

The reason for the spikes was that the fact that the I2C registers were
not read out correctly as suggested in the datasheet.

Before we were reading out ST1, data, and ST2 in one pass and ignoring
the data ready bit (DRDY) in ST1. This meant that we could run into race
conditions where the data was not ready when we started reading and
being updated as the registers are read.

Instead, we need to check the read the ST1 register first to check the
data ready bit and then read the data and ST2 if the data is ready. By
reading ST2 we then trigger the next measurement in the chip.
2019-11-12 10:04:35 -05:00
Julian Oes 035e81e084 ak09916: cleanup only
Note: the author name was removed because this file has almost no
resemblence with the code written by that author 4 years ago, has been
copied to new places, and was initially commited without author anyway.

Also, my opinion is that the version control system should take care of
attribution, and not outdated comments.
2019-11-12 10:04:35 -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 26364d44c9 px4_work_queue: command line status output and shutdown empty queues
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
2019-10-02 12:23:17 -04:00
Daniel Agar 78ef8aab2d STACK_MAIN increase default 1024 -> 2048 2019-08-30 19:11:51 -07:00
Beat Küng f8e0441e7b src/platforms/common: move to platforms/common
Script to update include paths:
for i in $(grep -rl 'include <px4_work_queue' src platforms); do sed -i 's/#include <px4_work_queue/#include <px4_platform_common\/px4_work_queue/' $i; done
2019-08-30 07:59:44 +02:00
RomanBapst c0053409a3 ak09916: fixed driver not reporting magnetometer as external
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-07-25 13:17:08 +02:00
Bob Long 84a0d16386 Clarify weird behavior of the LIS3MDL
See issue #12514
2019-07-21 12:08:26 -04:00
Daniel Agar d4cd1d0d2e NuttX stm32f7 fully re-enable dcache with write back (#12435)
- fixes https://github.com/PX4/Firmware/issues/12216
 - includes latest PX4/NuttX and apps update 7.29+
2019-07-10 19:08:12 -04:00
Daniel Agar f593e3de9c AK09916 move to new WQ, PX4Magnetometer, and cleanup 2019-05-29 13:59:08 -04:00
Daniel Agar 8e6708bdcb qmc5883 move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar 8f1b4f693b rm3100 move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar 8176fe1b6e lsm303agr move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar dffaf544ab lis3mdl move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar 537c139134 bmm150 move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar 83d3ead821 ist8310 move to px4 work queue 2019-05-24 12:58:55 -04:00
Daniel Agar 70947920b8 hmc5883 move to px4 work queue 2019-05-24 12:58:55 -04:00
Julian Oes c78aaeb0f7 ak09916: fail if device is not found
This should fix the case where the driver initializes even though the
device is not found. The change changes the behavior to return ERROR
if the whoami call fails several times instead of returning OK.

Also, the reset() and thus probe() calls are moved before initializing
the ringbuffer and device name.
2019-04-20 12:52:56 +02:00
Andreas Daniel Antener 95a0803b14 Adding AK09916 driver to support the Here2 GNSS emulated mag (I2C) (#11837)
* drivers, magnetometer: added ak09916 driver to support the mag driver emulated by the Here2 gps
* boards: set yaw 270 rotation for external ak09916 driver and only start it for the PH21
* drivers: only start ak09916 when icm20948 is not available on a ph21 setup
2019-04-11 12:43:50 -04:00
David Sidrane fd31091fdb bmm150:Restored lost internal i2C 2019-04-02 13:40:17 -04:00
Pandacoolcool 35af8f3368 ist8310.cpp: fix code style 2019-03-18 11:05:12 +01:00
Pandacoolcool 875661d70c ist8310.cpp: remove unused variable 2019-03-18 11:05:12 +01:00
Daniel Agar b35d048566 cmake enable -Wcast-align and disable per module 2019-03-16 11:47:15 -04:00
mcsauder 2ae2331c15 Delete extra newline character in qmc5883/CMakeLists.txt to quiet git hook. 2019-03-12 14:59:08 -04:00
dlwalter 77ab9b617e QMC5883 Magnetometer Driver (#11140) 2019-03-08 22:04:43 -05:00
Beat Küng ae335f6bd8 Fixed using myoptarg instead of optarg
Co-Authored-By: BazookaJoe1900 <BazookaJoe1900@gmail.com>
2019-02-21 09:45:45 +01:00
Beat Küng 8e991f1878 Fixed using myoptarg instead of optarg
Co-Authored-By: BazookaJoe1900 <BazookaJoe1900@gmail.com>
2019-02-21 09:45:45 +01:00
bazooka joe 922c19aa9c using only px4_getopt() and never the unsafe getopt()
using only <px4_getopt.h> as include, cleanup related includes
added check that all the option are valid (myoptind >= argc). if there are invalid options on some script that might now lead not to run commands
2019-02-21 09:45:45 +01:00
Daniel Agar 2ffb49b734 delete px4_includes.h header and update boards/ to use syslog 2019-01-23 18:25:18 -05:00
Kevin Lopez Alvarez 490eeeb9d9 RM3100: enable I2C (#11038) 2019-01-09 08:57:19 -05: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 dd0baaee91 delete IOCTL SENSORIOCSQUEUEDEPTH
- only used in test routines
2018-11-06 07:43:43 +08:00
Daniel Agar d2ed091a1d delete IOCTL SENSOR_POLLRATE_MAX
- only SENSOR_POLLRATE_DEFAULT is needed
2018-11-06 07:43:43 +08:00
Daniel Agar 556a9422b5 delete IOCTL SENSOR_POLLRATE_MANUAL
- only used in self tests
2018-11-06 07:43:43 +08:00
Daniel Agar 8dfd55fc9e delete unused IOCTL SENSORIOCGPOLLRATE 2018-11-06 07:43:43 +08:00
Daniel Agar d76155107c delete unused IOCTL MAGIOCGRANGE 2018-11-06 07:43:43 +08:00
Daniel Agar 0ea18b2b73 delete unused IOCTL MAGIOCGSAMPLERATE 2018-11-06 07:43:43 +08:00
Daniel Agar 60a40ec131 delete unused IOCTL MAGIOCSSAMPLERATE 2018-11-06 07:43:43 +08:00
Daniel Agar f59f0d4b2d delete unused IOCTL SENSOR_POLLRATE_EXTERNAL 2018-11-06 07:43:43 +08:00
hdiethelm 33422700de lis3mdl: fix handling when multiple sensors are available (#10753)
* lis3mdl: Report calibration successful when starting with -C option
* lis3mdl: Use PX4_OK, PX4_ERROR for return value / orb_unadvertise
* Fixes #10740
2018-11-01 10:44:41 -04:00
Daniel Agar ee90eb6c92 IST8310 increase MAIN stack 2018-09-02 16:15:03 -04:00
Daniel Agar 7cc0e69fcd add px4fmu-v{3,4,5} stackcheck configs 2018-09-02 14:16:04 -04:00
Kevin Lopez Alvarez c10ea132b4 PNI RM3100 magnetometer driver (#10302)
* tested on SPI (px4fmu-v4pro)
 * WIP I2C support
2018-08-28 11:44:34 -04:00
Daniel Agar 568a5f1c4c delete ACCELIOCSELFTEST and GYROIOCSELFTEST 2018-08-02 08:05:52 +02:00
Daniel Agar bb9c38a480 delete MAGIOCSELFTEST 2018-08-02 08:05:52 +02:00
Daniel Agar cc96e5ec5e sensor messages remove unused fields and improve comments 2018-07-29 21:04:21 +02:00
Daniel Agar be3af59c76 lsm303agr flip z axis and properly set scaling and range 2018-07-28 15:22:20 +02:00
Daniel Agar 14cf92d8b2 lsm303agr split main 2018-07-28 15:22:20 +02:00
Daniel Agar b1d3bb0403 stop ignoring Wmissing-field-initializers and fix (#9912) 2018-07-22 12:45:52 -04:00
Daniel Agar 4e4724f9eb add ST LSM303AGR driver (mag only) 2018-07-08 10:18:13 -04:00