Commit Graph

21684 Commits

Author SHA1 Message Date
Beat Küng b1be963083 px4fmu_test rcS: switch to led_control command 2017-03-12 00:08:35 +01:00
Beat Küng 46fef30526 systemcmds: add new command led_control
This can be used to test & control the new uorb-based led backend.
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 95e8e26ae0 commander: use led_control uorb topic 2017-03-12 00:08:35 +01:00
Beat Küng 8dae94d90a lib/led: add BREATHE mode (but not implemented yet) 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
Beat Küng 4b1bbaa114 posix: remove rgbledsim driver which does nothing
In addition this is almost a copy of the rgbled driver
2017-03-12 00:08:35 +01:00
Julian Oes 404719953c commander: fix abs bug / trigger POSCTL both ways
The check if stick were touched was only working in one direction (per
axis) because fabsf was used incorrectly.

However, this check is still only a differential check triggered by
fast movement and does not trigger if someone slowly moves a stick to
the side. Also, the sensitivity depends on the rate of the commander
loop and/or the RC update loop. The correct solution would be a proper
filtering and trigger for movement.
2017-03-11 22:41:23 +01:00
Lorenz Meier fb64403607 Updated jMAVSim 2017-03-11 22:03:17 +01:00
Lorenz Meier 86a8e95017 Update jMAVSim to fix compatibility with recent java versions 2017-03-11 21:37:06 +01:00
David Sidrane 5a66539b36 HOTFIX:Backport Memory corruption due to stack coloring overreach
Backport of upstream NuttX PR 264

   As discovered by dcabecinhas. This fix assume the 8 byte
   alignment options for size stack size or this will overwrite
   the first word after TOS
   See https://github.com/PX4/Firmware/issues/6613#issuecomment-285869778
2017-03-11 20:26:51 +01:00
Daniel Agar 742d0e53f9 examples NULL to nullptr 2017-03-11 11:40:14 +01:00
Daniel Agar 0611677ee2 segway move to examples 2017-03-11 11:40:14 +01:00
Daniel Agar 89ff9f1fe3 cmake fmu-v3 fix and enable more examples
- sync posix_sitl_default and px4fmu-v4pro/v5 with fmu-v3
 - fixes #6667
2017-03-11 11:40:14 +01:00
Beat Küng 4811ab6b13 logger: reduce rate of some topics
In SITL, logging rate reduces from 70kB/s to 45kB/s.
2017-03-11 10:30:38 +01:00
José Roberto de Souza f61b830ae9 nuttx-configs: aerofc: Enable CONFIG_STM32_FLASH_WORKAROUND_DATA_CACHE_CORRUPTION_ON_RWW
Now AeroFC is making use of both flash memory banks so it need this
workaround.
2017-03-11 10:30:04 +01:00
José Roberto de Souza 03e3877535 nuttx-patches: Add workaround for flash data cache corruption on read-while-write 2017-03-11 10:30:04 +01:00
David Sidrane c967cade47 HOTFIX:Backport of second round upstream NuttX i2c fix (#6771)
backport 3cd66af889b42b036d6c9d88e067fc3b8abbdb2a and pr 258

   Applies to STM32F4 and STM32F7

   STM32, STM32 F7, and STM32 L4: Clone Freddie Chopin's I2C change to similar STM32 I2C drivers.

   Save elapsed time before handling I2C in stm32_i2c_sem_waitstop()
   This patch follows the same logic as in previous fix to
   stm32_i2c_sem_waitdone().
   It is possible that a context switch occurs after I2C registers are read
   but before elapsed time is saved in stm32_i2c_sem_waitstop(). It is then
   possible that the registers were read only once with "elapsed time"
   equal 0. When scheduler resumes this thread it is quite possible that
   now "elapsed time" will be well above timeout threshold. In that case
   the function returns and reports a timeout, even though the registers
   were not read "recently".
   Fix this by inverting the order of operations in the loop - save elapsed
   time before reading registers. This way a context switch anywhere in the
   loop will not cause an erroneous "timeout" error.
2017-03-10 07:26:51 -10:00
David Sidrane 60c8c84e18 HOTFIX:Backport of upstream NuttX i2c fix
5a6d95dd9f051be548a8d2378aaef75f0a1ba5e1 and ee5ae3a57dbbe835584f164c956e0374da1ed2eb

   Applies to STM32F4 and STM32F7

   Save elapsed time before handling I2C in stm32_i2c_sem_waitdone()
   It is possible that a context switch occurs after stm32_i2c_isr() call
   but before elapsed time is saved in stm32_i2c_sem_waitdone(). It is then
   possible that the handling code was executed only once with "elapsed
   time" equal 0. When scheduler resumes this thread it is quite possible
   that now "elapsed time" will be well above timeout threshold. In that
   case the function returns and reports a timeout, even though the
   handling code was not executed "recently".
   Fix this by inverting the order of operations in the loop - save elapsed
  time before handling I2C. This way a context switch anywhere in the loop
  will not cause an erroneous "timeout" error.
2017-03-10 12:15:10 +01:00
José Roberto de Souza 07921c9f3a aerofc: Use ram_flash dataman backend 2017-03-10 11:31:07 +01:00
José Roberto de Souza e2aae04c95 modules: dataman: Add a ram_flash backend
This backend will keep all updated data in RAM and
persist the data between reboots using flash memory.

Using only flash memory would result in a slow backend that
would decrease the lifetime of the flash memory, using both
we can reduce the several cycles of erase & write into flash
and keep the performance of the backend almost as fast
as the RAM only backend.

Note: Do not use this backend on a sector from the same flash memory
bank as the memory bank that STM32 read instructions or it can block
the CPU from fetching instructions from flash during the erase and
write operations and cause your drone crash.
2017-03-10 11:31:07 +01:00
José Roberto de Souza 75e7cfcbe8 modules: flashparams: Change size to uint32_t
So flash sector of 64Kbyes and 128Kbytes can also be used.
2017-03-10 11:31:07 +01:00
José Roberto de Souza a2670bdbc8 modules: dataman: Move backend specific out of main routines 2017-03-10 11:31:07 +01:00
José Roberto de Souza 66d9d56525 modules: dataman: Share memory between backends
Also having just a boolean to track if backend is running.
2017-03-10 11:31:07 +01:00
Beat Küng 8d5ba63686 tap-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 374dc1be4c px4nucleoF767ZI-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng d25218eba2 px4fmu-v5 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 3848432302 px4fmu-v4pro NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 1f520f15a3 px4fmu-v4 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng b73cd50863 px4fmu-v3 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng b89451f160 px4fmu-v2 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 0ffcf70a84 px4fmu-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 58aff84911 stm32f4discovery NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 6170544738 mindpx-v2 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 3ac953db0e esc35-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 9862f1c5f9 crazyflie NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 34a2326c12 auav-x21 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng ab541b1321 px4esc-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng 3cdec49a09 aerofc-v1 NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng d10848c129 aerocore NuttX defconfig: lower CONFIG_DEV_PIPE_SIZE to 70
This saves almost 2kb of RAM when using the mavlink shell. 70 matches the
size of the mavlink message. Since the pipe is blocking, a process writing
a lot of data will just wait, data will not be dropped.

The mavlink shell is the only process creating a pipe.
2017-03-10 11:29:09 +01:00
Beat Küng cfcc75d444 mavlink shell: check if there's enough free buffer to send the mavlink message
if there is not, the process on the other end of the pipe will just block.
This improves reliability over slow links.
2017-03-10 11:29:09 +01:00
Beat Küng 644d237ce6 posix-configs scripts: remove unneeded 'sleep 1'
There is no need to wait, and it would be the wrong way of doing
startup synchronization.
2017-03-10 11:28:41 +01:00
Beat Küng b1e27f4395 simulator: handle ctrl-c during startup correctly
This makes sure the px4 process does not hang when Ctrl-C is pressed
during startup.
2017-03-10 11:28:41 +01:00
Beat Küng 9597e708df sensors: remove sensors_init
The initialization code is redundant and incomplete (only the first sensor
is done). I verified that all drivers already set this on startup.
For the mags, they all set their maximum supported update rate.
For the baro, the call can silently fail, as for example the MS5611 which
does not support 150Hz update. But it also sets the maximum in
initialization.

Tested on Pixhawk & pixracer.
2017-03-10 11:28:41 +01:00