Commit Graph

36 Commits

Author SHA1 Message Date
Lucas De Marchi 16c1bc1b0e AP_HAL_Linux: Util: fix coding style for pointers 2017-04-19 00:19:40 -07:00
Lucas De Marchi 9aa2a3938c AP_HAL_Linux: Util: make get_custom_log_directory const override final
While at it, add final and override to mark this as being the overriden
final implementation of this method.

Thanks to Phillip Khandeliants (@khandeliants) for reporting.
2017-04-19 00:19:22 -07:00
Lucas De Marchi 008e631147 AP_HAL_Linux: Util: fix overriden function signature
While at it, add final and override to mark this as being the overriden
final implementation of this method.

Thanks to Phillip Khandeliants (@khandeliants) for reporting.
2017-04-18 23:57:54 -07:00
Mathieu OTHACEHE 60ba91aead Disco: add buzzer support
Use ToneAlarm class to handle Disco buzzer.
2016-11-07 18:02:21 -03:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Lucas De Marchi f37a560295 AP_HAL_Linux: remove private headers
This centralized private header encourages centralizing things on
umbrella headers that are a pain to maintain. Force each part of
AP_HAL_Linux to include what is used.
2016-07-29 20:29:46 -03:00
Lucas De Marchi f36e8d9c05 AP_HAL_Linux: remove AP_HAL_Linux_Namespace header
This centralized namespace header encourages centralizing things on
umbrella headers that are a pain to maintain. Force each part of
AP_HAL_Linux to include what is used.

While at it, do some whitespace cleanups and minor changes to adhere to
coding style.
2016-07-29 20:25:03 -03:00
Andrew Tridgell aaaa6d38c7 HAL_Linux: initial support for Disco 2016-07-20 13:35:51 +10:00
Andrew Tridgell 461c159b22 HAL_Linux: use set_imu_target_temp() API 2016-07-01 15:29:52 +10:00
Lucas De Marchi 619ce23799 AP_HAL_Linux: Perf: rework integration with other tools
The idea is to leave the internal perf enabled all the time, like it is
in PX4, and then allow the integration with lttng on top. Next step
would be to runtime enable/disable only the perf counters we are
interested in.

This also changes the structure so it's easy to allow another thread to
pull data from the Perf object. A rw lock protects from addition of new
counters and an atomic unsigned int allows other threads to do a
lockless copy of the data.

In order for this to work the allocation was changed to use a single
memory pool instead of returning a calloc'ed data for each perf counter.
Since most of our counters are of ' elapsed' type, don't bother using a
smaller struct for the 'count' type
2016-06-23 19:06:30 -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
Pritam Ghanghas 6de5b52974 AP_HAL_Linux: separate class for tone alarm driver 2016-03-18 21:51:36 -03:00
Lucas De Marchi 705393b30c AP_HAL_Linux: replace header guard with pragma once 2016-02-18 14:52:35 -02:00
Julien BERAUD b6f51233db AP_HAL_Linux: Make RPI get_hw method public
Valid also on Bebop
2015-12-27 16:11:36 -02:00
Andrew Tridgell c77e3c89c5 HAL_Linux: implement new_semaphore() 2015-12-20 17:55:39 +11:00
Lucas De Marchi d19c5035b6 Global: Rename printf format attribute
As commented in 8218140 ("AP_Common: add scanf format macro"), "FORMAT"
was a bad name for this macro since there's also the scanf. Rename to
FMT_PRINTF to follow the scanf name.
2015-12-01 07:22:12 +11:00
José Roberto de Souza 5ff67a41a1 AP_HAL_Linux: Implement perf API
Initial implementation of perf API on Linux, for now just saving
perf data, in a further patch this data will be exported.
2015-11-13 12:16:19 +11:00
Lucas De Marchi 392879112e AP_HAL_Linux: document functions to write file
Document function and add attributes to mark then as printf- and
scanf-like functions.
2015-11-10 17:05:34 +11:00
José Roberto de Souza 39bd5fa80e AP_HAL_Linux: Add PWM_Sysfs
This class makes easy to use Linux PWM sysfs interface, available since
Linux 3.10.

More information https://www.kernel.org/doc/Documentation/pwm.txt
2015-11-10 17:05:34 +11:00
Andrew Tridgell 883ac59e4a HAL_Linux: always report 256k of available memory 2015-11-05 16:09:00 +11:00
Lucas De Marchi 2ac96b942c AP_HAL_Linux: remove prefix from AP_HAL_Linux classes
We have already a Linux namespace, so there's no need to prefix Linux on
all names.
2015-10-21 10:11:19 +11:00
Julien BERAUD ffbb892a01 AP_HAL_Linux: add support for a pwm heater
It uses a heating resistor controlled by a pwm.
By changing the duty cycle of the pwm, we can control the temperature.
A simple PI algorithm is used in order to get to the correct temperature
fast enough and without too much overshoot
It is implemented as a member of the Util class in order not to make to much
modification to the current codebase
2015-10-06 15:21:39 +11:00
Lucas De Marchi 54c2c5f682 AP_HAL_Linux: use method for downcast
Instead of just doing a static cast to the desired class, use a method
named "from". Pros:

  - When we have data shared on the parent class, the code is cleaner in
    child class when it needs to access this data. Almost all the data
    we use in AP_HAL benefits from this

  - There's a minimal type checking because now we are using a method
    that can only receive the type of the parent class
2015-09-23 09:01:29 +10:00
Gustavo Jose de Sousa 124b750c10 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-11 16:28:43 +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 790f4ec56c HAL_Linux: Util fix indentation 2015-06-30 14:35:59 +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
Víctor Mayoral Vilches 974f243c7e HAL_Linux: Add set_system_clock 2015-01-22 15:43:16 +11:00
bugobliterator 329c1f5190 HAL_Linux:create ToneAlarmDriver as a separate class
ToneAlarm is now declared as a separate class instance of which is added as a private member of LinuxUtil
Some minor fixes in this patch include changing return type of tonealarm_init() to bool and use dprintf
2014-11-15 16:59:06 +11:00
bugobliterator 3b94cb3072 HAL_Linux: make tonealarm generation a passthrough operation
get rid of all delays and while loops(that may turn into infinite loop)
2014-11-15 16:59:06 +11:00
bugobliterator e254b406d0 HAL_Linux: make rtttl tune and tune repeat flag list static members
instead of initialising them inside constructor
2014-11-15 16:59:06 +11:00
bugobliterator af203760bd HAL_Linux: change the return type of AP_HAL::Util::tonealarm_init() to signed int8_t.
This is a part of a set of fixes for the bugs and typos tridge discovered and shared inside earlier commits for setting up tonealarm.
2014-11-10 06:27:48 +11:00
bugobliterator 298b27444a HAL_Linux: Add ToneAlarm Driver to Linux_HAL
ToneAlarm is setup for Beaglebone Black using pwm, toneAlarm thread runs on second last priority.
2014-11-10 06:27:48 +11:00
Andrew Tridgell 735c6449a1 AP_HAL: added support for commandline arguments
useful for log replay, specifying log file
2014-02-23 08:15:39 +11:00
Andrew Tridgell 4ba044c441 AP_HAL_Linux: initial Linux AP_HAL 2013-09-28 21:24:01 +10:00