14330 Commits

Author SHA1 Message Date
Matthias Grob
5a00cb4770 MPU6000 driver: change default accelerometer range to +-16g
This range amkes much more sense for MAV applications.
It reduces vibration vulnerability caused by measurement range clipping.
2017-03-30 19:07:59 +02:00
Dennis Mannhart
419c474d53 mc_pos_control: manual input temporary yaw fix 2017-03-30 16:43:43 +02:00
Beat Küng
74f4aecbf8 random.c: remove unused & conflicting RAND_MAX 2017-03-29 23:02:09 +02:00
Beat Küng
358bcb6ae0 visibility.h: add #pragma GCC poison getenv setenv putenv
Just to make sure that it will never be used on NuttX. This is not an
architectural limitation, just a memory optimization, since we call
clearenv() on NuttX.
2017-03-29 23:02:09 +02:00
Beat Küng
4a7e02c640 systemlib/visibility.h: remove this file
This is duplicated in src/include/visibility and is directly included via
compiler flag '-include'
2017-03-29 23:02:09 +02:00
Beat Küng
be2d10ff45 px4_nuttx_tasks: call clearenv() before task_create
Frees up around 6kB of RAM on Pixracer & Pixhawk.
2017-03-29 23:02:09 +02:00
ChristophTobler
80e7475267 use snapdragon_pwm_out and change connector for RC 2017-03-29 20:11:34 +02:00
David Sidrane
90fe63bb53 Fixes dead aux channels introduce in oneshot
Returned the fmu mixer code to where it updated the HW once
   it has a mixer. But  only signals a up_pwm_update() for
   onshots on actual control update.

   Before this change the hw outpuse were not updated.
2017-03-28 22:57:00 +02:00
Beat Küng
d7703173b2 Critical: Fixes Snapdragon Flight parameter synchronization problem (#6910)
* cmake: Fixes problem caused when the generated parameters.xml differs for the ARM and DSP builds.

* fix px4_getopt.h: add accidentally removed file
2017-03-28 16:10:17 +02:00
David Sidrane
7ef3b92109 Fixes lost RC on px4fmu-v4
A recent change in in the fmu stops the instance when a
   xxxx_reset command is used issued if the fmu was not
   already running.

   That change left publications published and then on the
   next creation created a new publications was created.

   This change calls orb_unadvertise to mark the publication
   as un published so that on the next instantiations of the
   fmu it resumes publishing on the same publication.
2017-03-28 08:18:43 +02:00
Daniel Agar
79d15ad2f0 mavlink stream camera trigger broadcast DO_DIGICAM 2017-03-26 14:05:38 +02:00
Mohammed Kabir
679b59b8d4 lpe : default fusion flags for GPS-only use 2017-03-26 14:05:23 +02:00
Lorenz Meier
de6302c418 Update DriverFramework to include Mac OS SITL fixes 2017-03-26 12:44:49 +02:00
Sander Smeets
16515e1d1e VTOL standard transition use FW_PSP_OFF (#6728)
* VTOL back transition maintain FW_PSP_OFF

* VTOL Front transition FW_PSP_OFF rampup
2017-03-25 00:24:59 -04:00
Nate Weibley
9618b9417b Inline block param getter 2017-03-24 22:51:38 +01:00
Nate Weibley
f5ffdba4cc Move uORB Subscription getter to header file (#6891) 2017-03-24 15:47:22 -04:00
Jon Watson
8a6b6f9be5 Send MAVLink DO_DIGICAM_CONTROL on camera trigger (#6815) 2017-03-24 13:24:09 -04:00
David Sidrane
577b4cf2f9 zubaxgnss-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
f550631ecf s2740vc-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
92ca9fa035 px4flow-v2 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
cbdc6dde7d px4esc-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
c7ace100bf px4cannode-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
c8432ae273 esc35-v1 Use common/nuttx_stubs to not link scheduler 2017-03-24 16:22:47 +01:00
David Sidrane
78e2a293d2 Fix UAVCAN bootloader builds broken by os calls from stm32_flash
Recent upsteam NuttX changes needed by PX4 added sem_[wait|post]
   in the stm32_flash driver.

   UAVCAN Bootloaders do not use the OS's scheduler etal.
   This commit nops the sem_[wait|post] with linker magic.
   Which precludes the linking the nuttx scheduler in the
   bootloader build.
2017-03-24 16:22:47 +01:00
David Sidrane
8cdde42e32 px4io-v2:Fixed GPIO_PPM_IN definition 2017-03-23 08:33:03 +01:00
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
b01768addc px4iofirmware mixer uses new Oneshot API
As discusssed in https://github.com/PX4/Firmware/pull/6678#discussion_r104177663
   this take the safe approach to only call up_pwm_update on a valid mix
   it does keep intatct the riginal author (OA) had an intent.
2017-03-23 08:28:15 +01:00
David Sidrane
6309642c37 px4iofirmware registers uses new Oneshot API
1) Use up_pwm_retrigger to triger onshot
   2) Updated comment to explain why a rate of zero makes sense
      to set oneshot mode.
   3) Updated copyright
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
8984b441a0 pwm test uses Onshot API
At at a period greater than the the max Oneshot pulse width
  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
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
David Sidrane
0ce854ad55 Support onshot command 2017-03-23 08:28:15 +01:00
David Sidrane
6bc0420137 pwm warnx->PX4_WARN 2017-03-23 08:28:15 +01:00
David Sidrane
cdd961d2b9 pwm remove arch dependancy 2017-03-23 08:28:15 +01:00
David Sidrane
d92cb75b26 pwm use px4_getops 2017-03-23 08:28:15 +01:00