ardupilot/libraries/AP_HAL
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 build: removed all nocore.inoflag files 2015-11-16 08:05:17 +11:00
utility Minimize AP_Progmem.h includes 2015-10-30 14:35:32 +09:00
AP_HAL.h AP_HAL: create AP_HAL namespace and use for some HAL functionality 2015-11-20 12:25:24 +09:00
AP_HAL_Boards.h AP_HAL: HAL_COMPASS_AK8963_MPU9250_I2C to the supported list 2015-11-11 14:29:07 +11:00
AP_HAL_Macros.h AP_HAL: use noreturn attribute on panic 2015-06-08 21:09:08 +10:00
AP_HAL_Main.h AP_HAL: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
AP_HAL_Namespace.h AP_HAL: make code not depend on concrete HAL implementations 2015-10-21 09:16:07 +11:00
AnalogIn.h AP_HAL: AnalogIn: add missing include 2015-10-21 15:54:27 -02:00
GPIO.h AP_HAL: make new GPIO functions optional 2015-09-14 14:22:16 +10:00
HAL.cpp AP_HAL: add run() method 2015-10-21 09:16:07 +11:00
HAL.h AP_HAL: create AP_HAL namespace and use for some HAL functionality 2015-11-20 12:25:24 +09:00
I2CDriver.h AP_HAL: fixed I2C build on APM2 2014-07-14 09:44:35 +10:00
RCInput.h AP_HAL: Added deinit() method to RCInput 2015-07-23 08:51:37 +10:00
RCOutput.h AP_HAL: RCOutput: add methods to allow grouping writes 2015-10-06 10:42:18 +11:00
SPIDriver.h AP_HAL: Add support for using SPI devices of the same type. 2015-09-18 09:15:09 +10:00
Scheduler.h AP_HAL: remove unused function 2015-11-18 11:50:56 +09:00
Semaphores.h AP_HAL: standardize inclusion of libaries headers 2015-08-11 16:28:43 +10:00
Storage.h AP_HAL: removed old storage type read/write functions 2014-08-13 18:46:44 +10:00
UARTDriver.cpp AP_HAL: UARTDriver: remove _P() variants 2015-10-30 14:35:31 +09:00
UARTDriver.h AP_HAL: UARTDriver: remove _P() variants 2015-10-30 14:35:31 +09:00
Util.cpp AP_HAL: Remove Util::{v,}snprintf_P() 2015-10-30 14:35:06 +09:00
Util.h AP_HAL: make available_memory() uint32_t 2015-11-05 16:09:00 +11:00
system.h AP_HAL: create AP_HAL namespace and use for some HAL functionality 2015-11-20 12:25:24 +09:00