ardupilot/libraries/AP_HAL_Linux
Caio Marcelo de Oliveira Filho efbc7648b1 AP_HAL: create AP_HAL namespace and use for some HAL functionality
For certain basic functionality, there aren't much benefit to be able to
vary the implementation easily at runtime. So instead of using virtual
functions, use regular functions that are "resolved" at link time. The
implementation of such functions is provided per board/platform.

Examples of functions that fit this include: getting the current
time (since boot), panic'ing, getting system information, rebooting.

These functions are less likely to benefit from the indirection provided
by virtual interfaces. For more complex hardware access APIs the
indirection makes more sense and ease the testing (when we have it!).

The idea is that instead of calling

    hal.scheduler->panic("on the streets of london");

now use

    AP_HAL::panic("on the streets of london");

A less important side-effect is that call-site code gets
smaller. Currently the compiler needs to get the hal, get the scheduler
pointer, get the right function pointer in the vtable for that
scheduler. And the call must include an extra parameter ("this"). Now it
will be just a function call, with the address resolved at link time.

This patch introduces the first functions that will be in the namespace,
further patches will implementations for each board and then switch the
call-sites. The extra init() function allow any initial setup needed for
the functions to work.
2015-11-20 12:25:24 +09:00
..
examples HAL_Linux: fixed example build 2015-11-16 08:04:35 +11:00
AnalogIn_ADS1115.cpp AP_HAL_Linux: Add AnalogIn_ADS1115, common code 2015-11-04 13:58:24 +11:00
AnalogIn_ADS1115.h AP_HAL_Linux: Add AnalogIn_ADS1115, common code 2015-11-04 13:58:24 +11:00
AnalogIn.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
AnalogIn.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
AP_HAL_Linux_Namespace.h AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs 2015-11-10 17:05:34 +11:00
AP_HAL_Linux_Private.h AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs 2015-11-10 17:05:34 +11:00
AP_HAL_Linux.h AP_HAL: provide AP_HAL_MAIN() 2015-10-21 09:16:09 +11:00
ConsoleDevice.cpp AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
ConsoleDevice.h AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
dsm.cpp AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
dsm.h HAL_Linux: added low level DSM decoder 2014-10-08 12:50:50 +11:00
GPIO_BBB.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
GPIO_BBB.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
GPIO_Minnow.cpp AP_HAL_Linux: add GPIO definitions for minlure 2015-10-22 12:04:52 +11:00
GPIO_Minnow.h AP_HAL_Linux: add GPIO definitions for minlure 2015-10-22 12:04:52 +11:00
GPIO_RPI.cpp AP_HAL_Linux: GPIO, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
GPIO_RPI.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
GPIO_Sysfs.cpp AP_HAL_Linux: add GPIO_Sysfs 2015-10-22 12:04:52 +11:00
GPIO_Sysfs.h AP_HAL_Linux: add GPIO_Sysfs 2015-10-22 12:04:52 +11:00
GPIO.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
GPIO.h AP_HAL_Linux: GPIO, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
HAL_Linux_Class.cpp AP_HAL_Linux: move Util instantiation 2015-11-11 08:02:41 +11:00
HAL_Linux_Class.h AP_HAL_Linux: merge init() and run() 2015-10-21 09:16:08 +11:00
Heat_Pwm.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Heat_Pwm.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Heat.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
I2CDriver.cpp AP_HAL_Linux: use I2C_SLAVE_FORCE in case of error 2015-11-13 21:20:13 +11:00
I2CDriver.h AP_HAL_Linux: use I2C_SLAVE_FORCE in case of error 2015-11-13 21:20:13 +11:00
Perf.cpp HAL_Linux: don't flood the link with errors on uninitialised perf counter 2015-11-14 14:44:29 +11:00
PWM_Sysfs.cpp AP_HAL_Linux: rework PWM_Sysfs 2015-11-10 17:05:34 +11:00
PWM_Sysfs.h AP_HAL_Linux: rework PWM_Sysfs 2015-11-10 17:05:34 +11:00
px4io_protocol.h AP_HAL_Linux: new files for raspilot 2015-09-14 14:22:16 +10:00
RaspilotAnalogIn.cpp Remove use of PSTR 2015-10-30 14:35:04 +09:00
RaspilotAnalogIn.h AP_HAL_Linux: new files for raspilot 2015-09-14 14:22:16 +10:00
RCInput_AioPRU.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_AioPRU.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_PRU.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_PRU.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_Raspilot.cpp Remove use of PSTR 2015-10-30 14:35:04 +09:00
RCInput_Raspilot.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_RPI.cpp AP_HAL_Linux: Add RCInput_RPI, merge common code 2015-11-04 13:58:24 +11:00
RCInput_RPI.h AP_HAL_Linux: Add RCInput_RPI, merge common code 2015-11-04 13:58:24 +11:00
RCInput_UART.cpp AP_HAL_Linux: use variadic panic() 2015-10-24 14:26:36 +11:00
RCInput_UART.h AP_HAL_Linux: add support for RCInput through UART 2015-10-22 12:04:52 +11:00
RCInput_UDP_Protocol.h AP_HAL_Linux: Add Support for RCInput_UDP 2015-09-07 12:10:08 +10:00
RCInput_UDP.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_UDP.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_ZYNQ.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput_ZYNQ.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCInput.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_AioPRU.cpp AP_HAL_Linux: Improve loading firmware 2015-11-12 21:25:17 +01:00
RCOutput_AioPRU.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_Bebop.cpp Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
RCOutput_Bebop.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_PCA9685.cpp AP_HAL_Linux: don't log on failed semaphore 2015-11-03 11:08:00 +11:00
RCOutput_PCA9685.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_PRU.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_PRU.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_Raspilot.cpp Remove use of PSTR 2015-10-30 14:35:04 +09:00
RCOutput_Raspilot.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_Sysfs.cpp AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs 2015-11-10 17:05:34 +11:00
RCOutput_Sysfs.h AP_HAL_Linux: RCOutput: Add LinuxRCOutput_Sysfs 2015-11-10 17:05:34 +11:00
RCOutput_ZYNQ.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RCOutput_ZYNQ.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
RPIOUARTDriver.cpp Remove use of PSTR 2015-10-30 14:35:04 +09:00
RPIOUARTDriver.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
sbus.cpp HAL_Linux: fixed build warnings 2014-10-09 16:49:23 +11:00
sbus.h HAL_Linux: added SBUS decoder from PX4 project 2014-10-07 14:57:34 +11:00
Scheduler.cpp AP_HAL_Linux: Scheduler, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Scheduler.h Replace prog_char and prog_char_t with char 2015-10-30 14:35:30 +09:00
Semaphores.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Semaphores.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
SerialDevice.h AP_HAL_Linux: added SerialDevice interface 2015-07-29 08:36:05 +10:00
SPIDriver.cpp AP_HAL_Linux: SPIDriver, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
SPIDriver.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
SPIUARTDriver.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
SPIUARTDriver.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Storage_FRAM.cpp Remove use of PSTR 2015-10-30 14:35:04 +09:00
Storage_FRAM.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Storage.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Storage.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
system.cpp AP_HAL: create AP_HAL namespace and use for some HAL functionality 2015-11-20 12:25:24 +09:00
TCPServerDevice.cpp AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
TCPServerDevice.h AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
ToneAlarmDriver.cpp AP_HAL_Linux: added tonealarm support for raspilot 2015-09-14 14:22:16 +10:00
ToneAlarmDriver.h AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
UARTDevice.cpp AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
UARTDevice.h AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
UARTDriver.cpp AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
UARTDriver.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
UDPDevice.cpp AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
UDPDevice.h AP_HAL_Linux: standardize inclusion of libaries headers 2015-08-18 17:12:51 +10:00
Util_RPI.cpp AP_HAL_Linux: UtilRPI, add Erle-Brain 2 2015-11-04 13:58:24 +11:00
Util_RPI.h AP_HAL_Linux: remove prefix from AP_HAL_Linux classes 2015-10-21 10:11:19 +11:00
Util.cpp AP_HAL_Linux: Add PWM_Sysfs 2015-11-10 17:05:34 +11:00
Util.h AP_HAL_Linux: Implement perf API 2015-11-13 12:16:19 +11:00