Commit Graph

273 Commits

Author SHA1 Message Date
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
Víctor Mayoral Vilches
790f4ec56c HAL_Linux: Util fix indentation 2015-06-30 14:35:59 +10:00
Lucas De Marchi
623c5f0713 AP_HAL_Linux: check if I2C device is chardev 2015-06-30 09:10:54 +10:00
Lucas De Marchi
acc571c2c5 AP_HAL_Linux: add function to check if path is chardev
Utility function to allow checking if a certain path is a character
device.
2015-06-30 09:10:54 +10:00
Lucas De Marchi
a4c1b0d75f AP_HAL_Linux: add constructor to find I2C bus reliably
The device number in /dev may not be reliable from one boot to another
due to the initialization order of each bus.

For example, in Minnow Board Max, the exposed I2C buses may be i2c-7 and
i2c-8 or i2c-8 and i2c-9 depending if the platform driver in the kernel
is initialized before or after the PCI.

It also may change with different version and configuration of the DT or
UEFI used making another kernel driver to bind to the device. This means that
for Minnow Board Max we need to use something like below to pass to the
constructor:

	static const char * const i2c_devpaths[] = {
	    /* UEFI with lpss set to ACPI */
	    "/devices/platform/80860F41:05",
	    /* UEFI with lpss set to PCI */
	    "/devices/pci0000:00/0000:00:18.6",
	     NULL
	};

The devpath here is the one returned by udev with the following command:

	udevadm info -q path /dev/<i2c-device>

In contrary to the device number in /dev/i2c-N, this path in sysfs is
stable across reboots and can only change if there's a change in the
UEFI firmware or the board's device tree.

This patch assumes the currently supported boards don't have this
problem so it's not touching them.
2015-06-30 09:10:54 +10:00
Lucas De Marchi
ec5d0b6c08 AP_HAL_Linux: reorder members and methods and use C++ initializer 2015-06-30 09:10:53 +10:00
Vladislav Zakharov
be4b6033e4 AP_HAL_Linux: Navio RCInput reimplemented. 2015-06-29 16:45:43 +10:00
Vladislav Zakharov
e505eb2cd8 AP_HAL_Linux: Changes in Scheduler: Added defines for delays, RCIN_RERIOD changed 2015-06-29 16:45:42 +10:00
Víctor Mayoral Vilches
ab5f1b3a24 BusTest: Fix compilation error with AP_ADC 2015-06-26 21:59:22 +10:00
mirkix
7c55689aad AP_HAL_Linux: Fix loading Firmware 2015-06-18 10:13:49 +10:00
Andrew Tridgell
c44ab01be8 AP_HAL: use noreturn attribute on panic
should reduce coverity warnings
2015-06-08 21:09:08 +10:00
Andrew Tridgell
dbff6cab43 HAL_Linux: added udp example to help 2015-06-03 21:47:01 +10:00