Commit Graph

284 Commits

Author SHA1 Message Date
Gustavo Jose de Sousa 7ac51f60d0 AP_HAL_Linux: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-19 20:42:40 +09:00
Andrew Tridgell 50e07ccad6 HAL_Linux: added bcast flag for udp broadcast 2015-08-19 20:03:20 +09:00
Andrew Tridgell a5f01c7ada HAL_Linux: sped up UDP transfers by about 25x
allow more than 1 packetised transfer per tick
2015-08-19 20:03:16 +09:00
Andrew Tridgell 81a3d439a3 HAL_Linux: allow startup before network bringup
this makes it possible to bootup ardupilot before the desired network
interface is available. This is very useful for when using 3G dongles
in aircraft
2015-08-19 20:03:13 +09:00
Andrew Tridgell 288c20a58e HAL_Linux: implemented TCP server as a single driver
the wait flag just changes startup behaviour. The TCP server should
always be a server with listen and accept. We don't need two drivers
2015-08-19 20:03:11 +09:00
Andrew Tridgell bd1b35804a HAL_Linux: replace recvfrom with recv 2015-08-19 20:03:08 +09:00
Andrew Tridgell bbc8bdcef3 HAL_Linux: removed 0 timeout from sendto call 2015-08-19 20:03:06 +09:00
Staroselskii Georgii 879f4f7555 AP_HAL_Linux: fixed _parseDevicePath() in LinuxUARTDRiver
The current implementation doesn't throw an error on a malformed path string.

i.e. udp:192.168.1.1.14550 instead of udp:192.168.1.1:14550 may result in a memory leak or whatsoever.

The commit fixes the issue and outputs a nice error message if anything's wrong.
2015-08-19 20:03:05 +09:00
Staroselskii Georgii f66f583843 AP_HAL_Linux: renamed TCPClientDevice 2015-08-19 20:03:04 +09:00
Staroselskii Georgii 39048229cd AP_HAL_Linux: renamed TCPServerDevice
A more appropriate name for the class.
2015-08-19 20:03:03 +09:00
Staroselskii Georgii 50765229ca AP_HAL_Linux: made UARTDriver use TCPServerDevice 2015-08-19 20:03:02 +09:00
Staroselskii Georgii 0ec64a5d13 AP_HAL_Linux: added TCPServerDevice 2015-08-19 20:03:01 +09:00
Staroselskii Georgii 34c1fe6e66 AP_HAL_Linux: made UARTDriver use TCPClientDevice 2015-08-19 20:03:00 +09:00
Staroselskii Georgii 244cdb3507 AP_HAL_Linux: added TCPClientDevice 2015-08-19 20:02:59 +09:00
Staroselskii Georgii 595903f17c AP_HAL_Linux: got rid of TCP connection 2015-08-19 20:02:58 +09:00
Staroselskii Georgii 179fc4a781 AP_HAL_Linux: made UARTDriver use ConsoleDevice 2015-08-19 20:02:57 +09:00
Staroselskii Georgii 7ba960f265 AP_HAL_Linux: added ConsoleDevice 2015-08-19 20:02:56 +09:00
Staroselskii Georgii 4a79713081 AP_HAL_Linux: made UARTDriver use UDPDevice 2015-08-19 20:02:55 +09:00
Staroselskii Georgii 9e6c4fe176 AP_HAL_Linux: added UDPDevice 2015-08-19 20:02:54 +09:00
Staroselskii Georgii b59264007c AP_HAL_Linux: encapsulated LinuxUARTDriver::_deallocate_buffers 2015-08-19 20:02:53 +09:00
Staroselskii Georgii 26382e63df AP_HAL_Linux: made UARTDriver use UARTDevice 2015-08-19 20:02:52 +09:00
Staroselskii Georgii 0c582eeae6 AP_HAL_Linux: added UARTDevice 2015-08-19 20:02:51 +09:00
Staroselskii Georgii 7160c88d39 AP_HAL_Linux: added SerialDevice interface
Adds the interface that will be used for encapsulating various mediums
that can be used in the Linux port.
2015-08-19 20:02:50 +09:00
Staroselskii Georgii 9b25217757 AP_HAL_Linux: added _serial_start_connection 2015-08-19 20:02:49 +09:00
Staroselskii Georgii ed431e9857 AP_HAL_Linux: encapsulated LinuxUARTDriver::allocate_buffers 2015-08-19 20:02:48 +09:00
Staroselskii Georgii 4d28b4a962 AP_HAL_Linux: use defines instead of hardcoding fd numbers in UARTDriver 2015-08-19 20:02:47 +09:00
Jean-Baptiste Dubois f6aba6c952 HAL_Linux: add read_obs_data to RCOutput_Bebop 2015-07-23 21:49:28 +09:00
Staroselskii Georgii d7ac725a64 AP_HAL_Linux: fixed signal handler in RCInput_Navio
DMA is getting stopped in the separate method now. This is the best we
can get at the current time. It does yield slightly better experience
and works in the majority of cases.

The patch is a no bulletproof solution, though.

There's a possibility of corruption in case of e.g. a SIGKILL. There's
no signal framework at the time and the commit doesn't add one. That's
why all signals are handled in the same erroneous way. This is not a
good nor a final solution to the issue.

For the issue at hand a better fix might be porting the code to kernel
space but it's a rather tediuos task that we cannot undertake in the
couple of weeks.
2015-07-23 08:51:38 +10:00
Staroselskii Georgii 8528a7d159 AP_HAL_Linux: added deinit logic for RCInput_Navio
DMA needs to be stopped if a panic occurs.
2015-07-23 08:51:37 +10:00
Staroselskii Georgii f4d14f73ba AP_HAL_Linux: extended panic handling with RCInput deinitialization
The issue has already come up. There's no deinitialization mechanisms at the moment. As APM is rather software than firmware on Linux, there're some clean-up work that needs to be done. This commit triggers deinitialization of RCInput on a panic.
2015-07-23 08:51:37 +10:00
Lucas De Marchi cfc2972e51 AP_HAL_Linux: use ARRAY_SIZE macro 2015-07-21 14:24:58 +09:00
Jean-Baptiste Dubois 7dcfe1c667 RCOutput_Bebop: group channels write 2015-07-20 09:23:13 +10:00
Jean-Baptiste Dubois 9e5d13c1de RCOutput_Bebop: use CLOCK_MONOTONIC instead of CLOCK_REALTIME
CLOCK_MONOTONIC is not affected by discontinuous jumps in the system time.
2015-07-15 12:08:44 +02:00
Staroselskii Georgii 72820303d4 AP_HAL_Linux: set higher SPI speed for Navio
We can set a higher speed on newer Linux kernels since
52469b2a38.
The older ones will just floor the value.
2015-07-10 18:59:18 +10:00
Julien BERAUD 954ec71630 HAL_Linux: added rcout implementation for bebop 2015-07-10 16:46:30 +10:00
Julien BERAUD 7275e33e79 AP_HAL: add the possibility to have more than 1 i2c
Bebop drone has 3 i2c
2015-07-10 14:23:17 +10:00
Daniel Frenzel c49e44d02c HAL_LInux: RCInput for Navio
Cleaned the code a bit

Signed-off-by: Daniel Frenzel <dgdanielf@gmail.com>
2015-07-06 11:19:33 +10:00
Lucas De Marchi fde43a77b3 AP_HAL_Linux: allow to change spi device state
Allowing to change the SPI device state allows us to save the
information whether the device was already initialized and avoid 2
separate drivers to initialize it.
2015-07-06 10:48:06 +10:00
mirkix e6363ea95d AP_HAL_Linux: BBBMINI uses /dev/i2c-2 2015-07-06 10:09:21 +10:00
Lucas De Marchi b211b86204 AP_HAL_Linux: don't manually define number of spi devices
It's error-prone, let's make the compiler define it for us.
2015-07-06 10:07:22 +10:00
Andrew Tridgell 5f0302ed9f HAL_Linux: fixed chaining of getopt calls 2015-07-01 20:44:07 +10:00
Andrew Tridgell 355575f793 HAL_Linux: fixed chaining of getopt instances 2015-07-01 15:42:07 +10:00
Andrew Tridgell c8a6a02be1 HAL_Linux: don't do chardev test on subtype NONE
otherwise replay is broken
2015-07-01 15:36:34 +10:00
Andrew Tridgell 281f6d9caa HAL_Linux: cope with expansion of storage from 4096 to 16k 2015-06-30 16:45:49 +10:00
Gustavo Jose de Sousa 87776d8a4b Storage: define LINUX_STORAGE_SIZE correctly
The value for LINUX_STORAGE_SIZE was defined inconsistently against the one
defined for Linux boards in HAL_STORAGE_SIZE. That led to some values not
being written to the storage when running the test binary built at
libraries/StorageManager/examples/StorageTest.
2015-06-30 16:37:08 +10:00
Andrew Tridgell 761b39be03 HAL_Linux: removed extra include 2015-06-30 15:09:52 +10:00
Andrew Tridgell a3c7297d8e HAL_Linux: fixed setting of custom directories 2015-06-30 15:08:10 +10:00
Víctor Mayoral Vilches 2e7a4aa1e6 HAL_Linux: Implement custom dir. methods 2015-06-30 14:36:42 +10:00
Víctor Mayoral Vilches 5c4ae15deb HAL_Linux: Make use of GetOptLong
Use GetOptLong to process long args, support
custom terrain and log directories and update
_usage().
2015-06-30 14:36:00 +10:00
Víctor Mayoral Vilches 309511dc08 HAL_Linux: UARTDriver, const device_path
Class member set to const and set_device_path
accepts a const char* now.
2015-06-30 14:36:00 +10:00