Commit Graph

3462 Commits

Author SHA1 Message Date
Beat Küng f25549169c fmu: wait until running, and handle mode_rcin properly
when the fmu was already running in a pwm mode, changing to mode_rcin would
not have any effect.
2017-07-14 11:57:11 +02:00
Beat Küng 0909b58981 fmu.cpp: fix wrong command usage mode_pwm3cap2 -> mode_pwm2cap2 2017-07-14 11:57:11 +02:00
Beat Küng 053eb12329 Module documentation: switch to Markdown 2017-07-14 11:57:11 +02:00
Beat Küng 59bde454b5 ModuleBase: instanciate -> instantiate 2017-07-14 11:57:11 +02:00
Beat Küng 6ea9762117 fmu: convert to ModuleBase
Sorry for the large patch :)

- move cleanup into destructor (this was done on the wrong task before)
- move init into init() method
- sensor & peripheral reset do not start/stop fmu anymore
- remove err & errx (they do not release the lock and could lead to dead-
  locks)
2017-07-14 11:57:11 +02:00
Beat Küng 2da0ae45e5 fmu: some cleanup
g_port_mode was never changed.
2017-07-14 11:57:11 +02:00
Beat Küng 16740dd5cd io timers: fix some typos 2017-07-14 11:57:11 +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 46a7287178 linux_pwm_out: add support for ESC calibration 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
Beat Küng fc4affbb5f ocpoc_mmap_pwm_out: remove this driver, it's in linux_pwm_out now 2017-07-13 16:53:28 +02:00
Beat Küng d17a7b46e8 linux_pwm_out: add ocpoc_mmap mode 2017-07-13 16:53:28 +02:00
Beat Küng 8527c8276f drivers: rename rpi_pwm_out to linux_pwm_out 2017-07-13 16:53:28 +02:00
Beat Küng 5cbee15309 ocpoc_adc: make xadc_fd a local variable instead of a class member 2017-07-13 16:53:28 +02:00
Beat Küng 2cf88156a9 cmake: remove -Os from COMPILE_FLAGS in px4_add_module()
This is already added to the global list, and we already removed this
flag previously, but some of them sneaked back in.
2017-07-13 16:53:28 +02:00
Beat Küng 243ae00e4e rpi_pca9685_pwm_out: remove this driver, it's now in rpi_pwm_out 2017-07-13 16:53:28 +02:00
Beat Küng 51dc988914 rpi_pwm_out: fix mixing output handling (use correct number of outputs) 2017-07-13 16:53:28 +02:00
Beat Küng b6942115e1 rpi_pwm_out: add support for PCA9685 output 2017-07-13 16:53:28 +02:00
Beat Küng 723f67b39a refactor navio_sysfs_pwm_out: rename to rpi_pwm_out 2017-07-13 16:53:28 +02:00
Beat Küng 8ccbc068c2 RPI PCA9685: code cleanup 2017-07-13 16:53:28 +02:00
Beat Küng d898b555d3 rpi_rc_in: code cleanup 2017-07-13 16:53:28 +02:00
crossa 4bde004474 1. Add parameter name in head file
2. Remove printf in the cpp
2017-07-13 16:53:28 +02:00
crossa 917d520378 Check _rcinput_pub is null. 2017-07-13 16:53:28 +02:00
crossa d37280e99b REMOVE DEBUG INGO 2017-07-13 16:53:28 +02:00
crossa ed319ce5d5 1. Add comment written in English
2. Rewrite and rebase pca9685 driver
3. Try to fix issue when push the stick of channel 3 to the maxmum position, 0uswill be output to channel 1, should be maxmum pwm signal
4. Fix the code style
2017-07-13 16:53:28 +02:00
crossa ea2a3acbd8 This driver has been tested and finished first flight
Now I've fixed style of the code
2017-07-13 16:53:28 +02:00
crossa c89351c453 Add PWM output driver with raspberry pi+pca9685 module 2017-07-13 16:53:28 +02:00
crossa 4839e5cd19 Fix code style 2017-07-13 16:53:28 +02:00
crossa 7b108eb879 Reading the pwm signal from shared image.
Both 8 channels PPM encoder and 8 channels revicer are required.
Before launch px4, ppmdeocde programe should be launched.
To download ppmdecode programe,
visit https://github.com/crossa/raspberry-pi-px4firmware.
Pxfmini and navio are not popular autopilot hardware in china,
I can handly to purchase it.
So that I use raspberry pi to build autopilot separately.
This dirver help us to decode ppm single to pwm and pushlish it
2017-07-13 16:53:28 +02:00
David Sidrane fc30f2906f mpu9250:Use a cpu speed independant _reset_wait generations.
This change first pushes out the _reset_wait by 100 Ms.
   which is about 3 time longer then the code take to execute.

   Then it does the reset of the accel, gyro and mag and
   the ends the wait by setting _reset_wait to now+10 us.
2017-07-11 09:51:31 +02:00
David Sidrane 3f0d26c949 mpu6000:Support different clock freq per IC type 2017-07-11 09:51:31 +02:00
David Sidrane 3c42c8f7fa mpu9520:Use maximum clock rate
The MPU9250 and MPU6500 buth support 1 Mhz and 20 Mhz. Buy upping the clocc we will get the maximum clock rate the driver
   supports that is <= 20 Mhz. This will boost the FMUv4Pro SPI speed to 11.25 Mhz (it was half that)
2017-07-11 09:51:31 +02:00
David Sidrane 22d0ea15de px4fmu-v3:Add ICM20608 aliased to the PX4_SPIDEV_ACCEL_MAG to the v3 build
The Pixkhawk mini was not chip selecting the ICM20608 as it did
   not define PX4_SPIDEV_ICM_20608. This allow the fmu V2 rc code
   to init the ICM20608.
2017-07-11 09:49:22 +02:00
David Sidrane 195468bf06 px4fmuv4pro:Init GPIO_VDD_3V3_SENSORS_EN off at reset
Insure a 0.0 voltage initial condition on VDD_3V3_SENSORS
  By starting the GPIO_VDD_3V3_SENSORS_EN, low and deferring
  the GPIO init of the slave selects and drdy signals until
  board_app_initialize. We get ~ 180 ms of power off time
  with 0.00 voltage applied to the sensors.
2017-07-11 08:34:26 +02:00
Lorenz Meier c89bd5c8fd HMC5883: Fix range setup 2017-07-10 08:32:19 +02:00
Daniel Agar 585984fa0c fmuservo increase stack 2017-07-09 18:02:55 +02:00
Lorenz Meier 80461fad6b Camera trigger: Support triggering one image immediately.
This allows to re-enable the distance trigger and immediately take a picture. This is helpful to ensure survey areas are covered on entry and exit.
2017-07-09 14:49:21 +02:00
Daniel Agar f45b9048aa GPS driver increase stack (244 bytes left) 2017-07-09 13:09:22 +02:00
Daniel Agar e303c2ad89 eagle tree airspeed allow negative differential pressure 2017-07-08 21:54:04 +02:00
Lorenz Meier 24ffada340 MPU9250: Hold off from reboot a little longer. Fixes #7555 2017-07-08 16:38:18 +02:00
Lorenz Meier 9cd93dcf03 MPU9250: Fix boot on Pixhawk Mini
This requires further investigation. Hotfix.
2017-07-08 16:31:12 +02:00
David Sidrane f722614ec0 mpu9250:Stop per counter on failed read 2017-07-08 15:37:46 +02:00
David Sidrane fbf6532c25 mpu9250:reset the mag on the reset operation
This commit fixed a bug were the mag was orphened on a reset.
   That resulted in MAG timeouts on reset or test operations and
   left the mag in a broken state.
2017-07-08 15:37:46 +02:00
David Sidrane 8bd044e80e mpu9250:mag rework the setup to veify HW first
If the setup is unsucessful fo not register the devices or
   allocate resources.
2017-07-08 15:37:46 +02:00
David Sidrane aec109ac2c mpu9250:mag restructure to have proper retires for setup
We want to setup the mag interface with retries and report
  failurs.

  Move retry logic to contol point, instead of hiding re-reading
  the ID in ak8963_check_id.

  Allow it to fail once to overcome a read of 0 on firt read.
  after 2 failure report error to console and reset the
  mpu9250's I2C master (SPI to I2C bridge)

  The same retry logic is used on the ak8963_read_adjustments
  with a reset of the I2C master module after 5 fails. If it
  fails fter 10 retires. Disabel the mad and report the failure
  on the console, stating it is disabled.
2017-07-08 15:37:46 +02:00
David Sidrane 270dd5282a mpu9250:Add modify checked register api
Provide an API for the mag to use read-modify-write
2017-07-08 15:37:46 +02:00
David Sidrane ef67b75057 mpu9250:Added comment on BYPASSING the internal i2c master bridge 2017-07-08 15:37:46 +02:00
David Sidrane c3addd931c mpu9250:Issue error on console when a device fails to take initialization
On initialization, if after 3 retries to re-init the mpu9250 from
   the checked registers values, it fails. Ensure thath the fact the
   driver is exitting is logged to console.
2017-07-08 15:37:46 +02:00
David Sidrane 3272cc62d4 mpu9250: Do a reasonable post chip init validations, reporting errors
Check that the mpu9250's configured registers match the settings
   written to them. Attempt to fix any that do not up to 3 times.
   printing erros to the console on mismatches and returning
   faliure if after 3 attempts the any of the values are
   still wrong.
2017-07-08 15:37:46 +02:00
David Sidrane 7e293ab1d3 mpu9250:Fix errant comment 2017-07-08 15:37:46 +02:00