Commit Graph

551 Commits

Author SHA1 Message Date
Lucas De Marchi 3457dbcdf8 AP_HAL_Linux: rename lttng define
Like others, use HAVE_ prefix and name it HAVE_LTTNG_UST to be the same
name as exported by pkg-config While at it remove wrong comment with
_HELLO_TP_H.
2016-05-23 12:06:42 -03:00
Lucas De Marchi 13722b8858 AP_HAL_Linux: support 16 RCInput channels on Navio2 2016-05-23 09:12:33 -03:00
Andrew Tridgell ef210217dd HAL_Linux: cope with MAVLink2 in UDP driver for packetising 2016-05-23 10:10:03 +10:00
Andrew Tridgell 6f7d6269a8 AP_HAL_Linux: always build with MAVLink2 headers 2016-05-21 15:25:16 +10:00
Andrew Tridgell 31f8d26784 HAL_Linux: support mavlink2 build 2016-05-21 15:25:11 +10:00
Gustavo Jose de Sousa 9a100afede AP_HAL_Linux: Thread: add doc about rounding function 2016-05-20 16:31:15 -03:00
Lucas De Marchi 359417d544 AP_HAL_Linux: Thread: make sure pointer is aligned
Implementation of alloca() is very much architecture and compiler
dependent. Avoid the case in which it could return a non-aligned
pointer, which would mean Thread::_poison_stack() would do the wrong
thing.
2016-05-20 16:31:15 -03:00
Lucas De Marchi 7e49d0c53f AP_HAL_Linux: Thread: fix alignment warning
../../libraries/AP_HAL_Linux/Thread.cpp: In member function ‘void Linux::Thread::_poison_stack()’:
../../libraries/AP_HAL_Linux/Thread.cpp:87:31: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
         for (p = (uint32_t *) end; p > curr; p--) {
                               ^
../../libraries/AP_HAL_Linux/Thread.cpp:93:31: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
         for (p = (uint32_t *) end; p < curr; p++) {
                               ^
../../libraries/AP_HAL_Linux/Thread.cpp:98:39: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
     _stack_debug.start = (uint32_t *) begin;
                                       ^
../../libraries/AP_HAL_Linux/Thread.cpp:99:37: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t* {aka unsigned int*}’ increases required alignment of target type [-Wcast-align]
     _stack_debug.end = (uint32_t *) end;
                                     ^
2016-05-20 16:31:15 -03:00
Lucas De Marchi 18af4da690 AP_HAL_Linux: Thread: fix warning regarding shadow member
../../libraries/AP_HAL_Linux/Thread.cpp: In member function ‘void Linux::Thread::_poison_stack()’:
../../libraries/AP_HAL_Linux/Thread.cpp:63:20: warning: declaration of ‘start’ shadows a member of 'this' [-Wshadow]
     uint8_t *end, *start, *curr;
                    ^
2016-05-20 16:31:15 -03:00
Leandro Pereira 3555e439a4 AP_HAL_Linux: Simplify I2C initialization in HAL_Linux_Class 2016-05-20 10:12:17 -03:00
Aaron Wang Shi cb9cd9008a AP_HAL_Linux: fix bhat spi device driver build error 2016-05-20 10:09:50 -03:00
Lucas De Marchi 71e10c9132 AP_HAL_Linux: fix include order
Sort include alphabetically and make them in order:

Main header
system headers
library headers
local headers

While reordering, change a include of endian.h to our sparse-endian.h
which is more reliant to toolchain changes.
2016-05-18 23:05:56 -03:00
Lucas De Marchi 45c6b750f2 AP_HAL_Linux: remove ifdef checks for HAL_BOARD_LINUX
Everything inside libraries/AP_HAL_Linux is for Linux boards, there's
not need to add the ifdefs.
2016-05-18 23:05:56 -03:00
Gustavo Jose de Sousa d615628367 AP_HAL_Linux: I2CDevice: add missing stdio.h include
This was probably being included by another header, but it's not on
gcc >= 6.1 and glibc 2.23.
2016-05-16 13:12:53 -03:00
Ricardo de Almeida Gonzaga 2236640f66 AP_HAL_Linux: Fix typos 2016-05-13 19:20:06 -03:00
Lucas De Marchi 37f6b51746 AP_HAL_Linux: Scheduler: set stack sizes to 256k
Running the vehicles we check the stack size doesn't grow too much by
enabling the DEBUG_STACK in the scheduler. Even on 64bit boards the
stack is consistent around 4k. Just to be a little conservative, let it
be a little bit more that that: 256kB.

Since we have RT prio and we call mlock(), the memory for the stack of
each thread is locked in memory. This means we are effectively taking
that much memory. The default stack size varies per distro, but it's
common to have 8MB for 64 bit boards and 4MB for 32 bit boards. Here is
the output of ps -L -o 'comm,rtprio,rss $(pidof arducopter-quad)', showing the
RSS of arducopter-quad before and after this change:

Before:
	COMMAND         RTPRIO   RSS
	arducopter-quad     12 46960
	sched-timer         15 46960
	sched-uart          14 46960
	sched-rcin          13 46960
	sched-tonealarm     11 46960
	sched-io            10 46960

After:
	COMMAND         RTPRIO   RSS
	arducopter-quad     12  7320
	sched-timer         15  7320
	sched-uart          14  7320
	sched-rcin          13  7320
	sched-tonealarm     11  7320
	sched-io            10  7320
2016-05-12 13:35:23 -03:00
Lucas De Marchi b2d4da4b0a AP_HAL_Linux: Thread: allow to set stack size
This allows the code that is creating the thread to set the size of the
stack.
2016-05-12 13:35:23 -03:00
Lucas De Marchi d970451331 AP_HAL_Linux: Scheduler: debug stack usage 2016-05-12 13:35:23 -03:00
Lucas De Marchi f5f4aa7c21 AP_HAL_Linux: Thread: allow to debug stack usage 2016-05-12 13:35:23 -03:00
Staroselskii Georgii f7846403e1 AP_HAL_Linux: enabled SPI-driven LSM9DS1 for Navio 2 2016-05-10 17:24:43 -03:00
Lucas De Marchi 3315f46800 AP_HAL_Linux: inline I2C bus options for minlure
We don't need all the comments in the array declaration and we can
inline its declaration in the function call. This makes it easier to
copy it to other places.
2016-05-10 16:06:53 -03:00
Andrew Tridgell 2965e67d5d HAL_Linux: cope with non-root for Replay 2016-05-07 18:27:17 +10:00
Julien Beraud c22d791bfc AP_HAL_Linux: Add SPI driver for bebop 2016-05-03 16:43:39 -03:00
Julien Beraud 738096b3ae AP_HAL_Linux: Add support for Sonar GPIO 2016-05-03 16:43:39 -03:00
Staroselskii Georgii 60426faa52 AP_HAL_Linux: changed ADC logic a bit for Navio 2
- make voltage_average_ratiometric() the same as voltage_average()
- make read_latest() the same as voltage_average()

wip
2016-04-27 17:14:21 +03:00
Rustom Jehangir 4a10156b13 AP_HAL_Linux: Fix RCInput::read from stopping at any zero channel
This bug led to issues for us so it may help others to resolve it.
Currently, the AP_HAL_Linux RCInput::read(uint16_t*,uint8_t) function
only returns the first x nonzero channels. Once it hits a channel that
is set to zero, it stops and all remaining channels are returned as
zero, even if they are set. This causes discrepancies between the raw RC
input sent to the GCS and the RC input that is actually used on the
vehicle.

The fixes this issue and makes it behave exactly as it does on the
PX4_HAL code. We ran into this issue when sending rc_override messages
in which there were some channels set to zero.
2016-04-26 22:32:07 -03:00
mirkix 6e546ba181 AP_HAL_Linux: Fix compiler warning unused hal 2016-04-24 11:09:55 -03:00
mirkix 2aba5a4643 AP_HAL_Linux: BBBmini add second MPU9250 2016-04-24 10:57:57 -03:00
Randy Mackay 58e65c836f HAL_Linux: remove unused pru_chan_map from RCOutput 2016-04-23 23:06:24 -07:00
Randy Mackay d6d5bac419 RCInput_UART: remove unused _count, _direction
resolves a compiler warning
2016-04-23 23:06:23 -07:00
Andrew Tridgell c7dabad02c HAL_Linux: added uartF 2016-04-20 09:39:49 +10:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Andrew Tridgell 1e4fe7996e HAL_Linux: update URL 2016-03-25 20:47:53 +11:00
Lucas De Marchi 72b246e52c AP_HAL_Linux: fix use of 0-length array
0-length arrays are supported in C but forbidden in C++. GCC allows it
but clang is more strict:

../../libraries/AP_HAL_Linux/SPIDriver.cpp:75:35: fatal error: no matching constructor for initialization of 'Linux::SPIDeviceDriver [0]'
SPIDeviceDriver SPIDeviceManager::_device[0];
                                  ^
../../libraries/AP_HAL_Linux/SPIDriver.h:20:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 0 were provided
class SPIDeviceDriver : public AP_HAL::SPIDeviceDriver {
      ^
../../libraries/AP_HAL_Linux/SPIDriver.h:20:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided
../../libraries/AP_HAL_Linux/SPIDriver.h:25:5: note: candidate constructor not viable: requires 9 arguments, but 0 were provided
    SPIDeviceDriver(const char *name, uint16_t bus, uint16_t subdev, enum AP_HAL::SPIDeviceType type, uint8_t mode, uint8_t bitsPerWord, int16_t cs_pin, uint32_t lowspeed, uint32_t highspeed);
    ^
1 error generated.
2016-03-20 00:17:02 -03:00
raspilot 9d787e44cc AP_HAL_Linux: update spi table for raspilot 2016-03-18 21:51:37 -03:00
Lucas De Marchi c1623c21cc AP_HAL_Linux: rename ToneAlarmDriver to follow other names
We don't add "Driver" to the name of the files anymore.
2016-03-18 21:51:37 -03:00
Lucas De Marchi d52ee7c0a1 AP_HAL_Linux: ToneAlarmDriver_Raspilot: cleanup driver
- Fix coding style
  - Remove unused variables and members
  - Add virtual as needed and override where needed
2016-03-18 21:51:36 -03:00
Pritam Ghanghas 6de5b52974 AP_HAL_Linux: separate class for tone alarm driver 2016-03-18 21:51:36 -03:00
Lucas De Marchi 6a6175df1c AP_HAL_Linux: move dirname to I2CDevice core
All entries would need the "devices/" prefix and it's more natural not
using it.
2016-03-17 02:55:31 -03:00
Staroselskii Georgii f93e790717 AP_HAL_Linux: make Ublox work on the higher frequency
The lower speed was only valid for very old Navio's. All new boards ship
with the GPSs that support higher frequencies.
2016-02-27 03:06:50 -03:00
Staroselskii Georgii a327a8779e AP_HAL_Linux: added Navio2 support 2016-02-27 03:06:50 -03:00
Staroselskii Georgii 7187f26220 AP_HAL_Linux: use Raspberry Pi GPIO for Navio2 2016-02-27 03:06:50 -03:00
Staroselskii Georgii 6680baf777 AP_HAL_Linux: use MPU9250 for Navio2 2016-02-27 03:06:50 -03:00
Staroselskii Georgii c9869e768a AP_HAL_Linux: use Util_RPI for Navio2 2016-02-27 03:06:50 -03:00
Staroselskii Georgii 23a2cf45aa AP_HAL_Linux: added RCInput for Navio2 2016-02-27 03:06:50 -03:00
Staroselskii Georgii a24e9df765 AP_HAL_Linux: added AnalogIn_Navio2
This is a shim driver around the temporarily interface that is exported via
sysfs entries.
2016-02-27 03:06:50 -03:00
Lucas De Marchi 69f6a73c19 Global: fix missing renames for HAL_BOARD_SUBTYPE_LINUX_ERLEBOARD
Commit b87fd58 (AP_HAL: ERLEBOARD legacy support) renamed the define but
forgot some around.
2016-02-19 12:35:18 -02:00
Lucas De Marchi 3ace8b52de AP_HAL_Linux: use AnalogIn_IIO for minlure 2016-02-19 11:55:31 -02:00
Lucas De Marchi 4e034cd2e1 AP_HAL_Linux: AnalogIn_IIO: add scale for minlure 2016-02-19 11:55:31 -02:00
Lucas De Marchi f56a80cd80 AP_HAL_Linux: AnalogIn_IIO: return fixed board voltage
Return board voltage as 5V so we don't fail prearm checks.
2016-02-19 11:55:31 -02:00