Commit Graph

3207 Commits

Author SHA1 Message Date
David Sidrane 0d59e84953 px4io-v1:Fixed GPIO_PPM_IN definition 2017-03-23 08:33:03 +01:00
Lorenz Meier fd0efac2b5 IO driver: Run attitude control group limited until the device speed gets set 2017-03-23 08:28:15 +01:00
David Sidrane 5abdb8fbe9 Fixed spelling - onshot->oneshot 2017-03-23 08:28:15 +01:00
David Sidrane e04d43218a Revert "fmu add command line onshot mode"
This reverts commit 22738b1213fff704d288ec84976fa84ff9535aba.

   The command was added due to a lack of my understanding of how the pwm command can be used.

   The command is not needed as the all flag can be used or a proper
   mask WHIHOUT -g

   fmu task mode_pwm
   pwm rate -a -r 50 -d /dev/pwm_output0
   pwm arm
   pwm test -a -p 500

   fmu task mode_pwm
   pwm oneshot -a -d /dev/pwm_output0 is the same as pwm oneshot -m 0xff  -d /dev/pwm_output0
   pwm arm
   pwm test -a -p 500
2017-03-23 08:28:15 +01:00
David Sidrane 2368d94f53 Fixed low on stack waning 2017-03-23 08:28:15 +01:00
David Sidrane f32f194ad8 fmu add command line onshot mode 2017-03-23 08:28:15 +01:00
David Sidrane 75376b7793 Bugfix:Allow mode switch on a free timer 2017-03-23 08:28:15 +01:00
David Sidrane 11191e54e0 use io_timer_set_PWM_mode not direct reg 2017-03-23 08:28:15 +01:00
David Sidrane d21c44704d Propgate any errors in setting the rate up.
Since the Onshot<->PWM mode is changed based on rate. The
 this signale the higher layers that the operation is invalid

 test case:
   fmu task mode_pwm2cap2
   pwm oneshot -m 0xf -g 0 -d /dev/pwm_output0

   should fail, because all the channels in the group are
   not in the same mode.
2017-03-23 08:28:15 +01:00
David Sidrane f5bc3dbc4e drv_io_timer Support OneShot
1) Updated copyright
  2) Defined BOARD overrideable BOARD_PWM_FREQ and BOARD_ONSHOT_FREQ
     Not recogmended but allow experimentation
  3) Solved the support for BOARD_PWM_DRIVE_ACTIVE_LOW using
     the Polarity control bits as apposed to the negation of
     the ARR.
  4) Added a cache for getting a timers channels. This is static
     and benifits from the qucik response.
  5) Added a function to realocate all channes in a given timer
     from one mode to another.
  6) Removed the frequecy table in favor of the intended use of the
     channel mode set. At it is the way to determine the mode of a
     channel. Or in onshot's case a timers's complete set channels.
  7) Added 2 lowlevel mode changing functions:
     io_timer_set_oneshot_mode and io_timer_set_PWM_mode
     that encapsalate the changes in mode to one place
     in the code.
  8) Added io_timer_trigger (the up_pwm_update) with low
     latancy timer to time in updating.
  9) io_timer_set_rate - use sets to enforce all or none
     rules for switching  PWM<->OneShot.
     Onshot is entered using the very approriate rate of 0.
     Only deltas will change the HW state.
2017-03-23 08:28:15 +01:00
David Sidrane 96db91c468 drv_io_timer Add simplified Oneshot API
1) Define IOTimerChanMode_OneShot
   2) Added detailed commnent on .clock_freq and how it is used
   3) Added single additional API point in support of Onshot mode
      io_timer_trigger - That trigger all timer's channels in Oneshot
      mode to fire the oneshots with updated values.
2017-03-23 08:28:15 +01:00
David Sidrane 30c8e6efac drv_pwm_servo provide the simplified interface for OneShot
1) Validate timer paramater before using it.
  2) Allow rate of 0 to enter Oneshot mode
     At first blush this seamed like a hack, but at Mark
     pointed out to me, Onshot PWM does not have a rate
     So this is a realy a clever and beautiful simplification
     on his part!
  3) Exposes up_pwm_update that runs io_timer_trigger
     Which trigger all timer's channels in Oneshot mode to
     fire the oneshots with updated values.
2017-03-23 08:28:15 +01:00
David Sidrane 938824500c Only expose up_pwm_update for onshot
This api will REWORD
2017-03-23 08:28:15 +01:00
David Sidrane 6dc3b1cac6 Revert "add macro PX4FMU_TASK to board_config"
The fmu now support the commandline option to be run as a task
   or off a work queue.
   This reverts the board_config.h changes from commit
   e33af23122f5ee3030bb9745bbbf616b24c2a14a.

Conflicts:
	src/drivers/px4fmu/fmu.cpp
2017-03-23 08:28:15 +01:00
David Sidrane 71c25611b5 fmu warnx->PX4_WARN 2017-03-23 08:28:15 +01:00
David Sidrane fc099879be fmu can be run as a task or as worker thread
The new optional option is
  fmu [task] ....

  fmu task mode_pwm - start fmu as a task
  fmu  mode_pwm     - start fmu as a worker
2017-03-23 08:28:15 +01:00
David Sidrane 07834e51b7 fmu:Ensure work_stop still called work_cancel 2017-03-23 08:28:15 +01:00
David Sidrane 9227547886 fmu added comments & updated copyright 2017-03-23 08:28:15 +01:00
Mark Whitehorn 8b6b4ccee9 add macro PX4FMU_TASK to board_config 2017-03-23 08:28:15 +01:00
Mark Whitehorn f7f12759cd Revert "add timer validation call"
This reverts commit 30fe2aa4fb8c099028fd5ca4f50940e88eddbb08.
2017-03-23 08:28:15 +01:00
Mark Whitehorn bbebf980d8 add timer validation call 2017-03-23 08:28:15 +01:00
Mark Whitehorn b5169b0c7b uncomment FMU servo readback test 2017-03-23 08:28:15 +01:00
Mark Whitehorn dd25366b86 clean up timer_set_rate and add advice on hacking counter frequency 2017-03-23 08:28:15 +01:00
Mark Whitehorn 2d5588ae02 simplify oneshot mode selection; use zero PWM rate as indicator
cleanup and remove unused (new) params
2017-03-23 08:28:15 +01:00
Mark Whitehorn aa9fbbedd5 add oneshot mode capability
change fmu to task

increase fmu_servo task priority to max and enable true oneshot

use lowest FMU priority which minimizes jitter

constrain oneshot updates to control group 0 events
2017-03-23 08:28:15 +01:00
Beat Küng 546bd2b4d0 drivers: remove the overflow perf counter
This was used together with the read() interface, but we don't use that
so the counters are wrong.
2017-03-20 09:11:34 +01:00
David Sidrane 4fe29e5246 Fiexs frsky telemetry stack warning
WARN  [load_mon] frsky_telemetry low on stack! (164 bytes left)

Added 168 bytes = 160 needed + 8 bytes for head room
2017-03-18 10:54:49 +01:00
David Sidrane bef24b906e Removed v4pro cloned v4 inappropriate definitions (#6808)
* Remove remove safty swtich LED from FMU control

* Differentiate GPIO_BTN_SAFETY_FMU  from GPIO_BTN_SAFETY
2017-03-13 07:26:36 -10:00
Beat Küng 32cf540159 rgbled: make sure to load the params on startup 2017-03-12 00:08:35 +01:00
Beat Küng f22fc1c543 led: add breathe mode 2017-03-12 00:08:35 +01:00
Beat Küng df791cef94 RPi: make sure navio_rgbled works and add it to autostart 2017-03-12 00:08:35 +01:00
Beat Küng 83afc207d4 drv_rgbled.h: remove this, it's not used anymore 2017-03-12 00:08:35 +01:00
Beat Küng 729486f992 rgbled: switch to new led uorb interface 2017-03-12 00:08:35 +01:00
Beat Küng 7fd6748f34 rgbled_pwm: switch to new led uorb interface 2017-03-12 00:08:35 +01:00
Beat Küng 6debbcb20d navio: switch to new led uorb interface 2017-03-12 00:08:35 +01:00
Beat Küng 43b98d9a2f lib/led: add led class with led_control uorb topic
This is the new interface to control external LED's (user-facing).
Features:
- Supports maximum N Leds (where the board can define N)
- on/off/blink M times
- Different priorities
- Allows setting a single led or multiple at once
2017-03-12 00:08:35 +01:00
Beat Küng 5ebbbfc6bf rgbled_pwm: warnx -> PX4_WARN, NULL -> nullptr 2017-03-12 00:08:35 +01:00
Beat Küng b0439836f6 refactor drv_led.h: rename to drv_board_led.h
This makes it clear that it's used to control the board LED's, not external
LED's.
2017-03-12 00:08:35 +01:00
Beat Küng 61c1f6a8ef rgbled: warnx -> PX4_WARN and NULL -> nullptr 2017-03-12 00:08:35 +01:00
José Roberto de Souza 07921c9f3a aerofc: Use ram_flash dataman backend 2017-03-10 11:31:07 +01:00
Beat Küng 019386a5a0 bmi160: remove debug output 2017-03-10 11:28:41 +01:00
Michael Schaeuble 06c5cb506a Enable ICM 20608 on Pixhawk Pro 2017-03-08 04:18:48 +08:00
Mathieu Bresciani d67b6efda3 PixHawk Pro: Update mag IDs to have external higher priority 2017-03-07 23:43:28 +08:00
zthorson b8e72789cd px4fmu-v4: Formatting fixes
Signed-off-by: zthorson <zachthorson@gmail.com>
2017-03-05 11:42:27 +08:00
zthorson a716b105f5 px4fmu-v4: Only close down fmu drivers on reset if they weren't running
Signed-off-by: zthorson <zachthorson@gmail.com>
2017-03-05 11:42:27 +08:00
zthorson 63857c6afc px4fmu-v4: Fix for HIL Unable to Set Control Surfaces. Fixes #5651
The sensor_rest command added to the startup script for px4fmu_v4 hardware
was leaving the /dev/pwm_output0 driver open.  This would prevent the
pwm_out_sim module from registering as a simulated driver.  The result
would cause the system to properly boot in HIL mode, but you would not
be able to set any control surfaces.

Since sensor_rest and peripheral_reset are only used on initialization, the
drivers can be shut down after they have performed their reset functions.

Signed-off-by: zthorson <zachthorson@gmail.com>
2017-03-05 11:42:27 +08:00
Beat Küng 570aca98a3 pwm_out_sim: make sure g_pwm_sim is initialized with nullptr 2017-03-04 05:59:10 +08:00
Michael Schaeuble 497a210742 lis3mdl: Fix check_calibration() output
The previous implementation returned OK when the sensor was not calibrated and vice
versa. This fixes a preflight fail due to selftest failed.
2017-02-27 22:52:28 +01:00
Beat Küng 85708063d6 fix tap_esc: use correct ORB_ID for esc_status advertisement 2017-02-27 08:52:43 +01:00
José Roberto de Souza ef228b82aa boards: AeroFC: Make it a memory constrained system
The maximum number of missions was increased in almost 8 times in
recent commit: 9369262e63 navigator: allow more mission items.

As this board loads missions in RAM, now it don't have enough memory
to allocate causing dataman start to fail, so mark it as a memory
constrained system and reduce the number of maximum missions
supported.
2017-02-23 08:26:42 +01:00