mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-02 14:13:42 -04:00
7ac51f60d0
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.
38 lines
1.4 KiB
C
38 lines
1.4 KiB
C
|
|
#ifndef __AP_HAL_LINUX_H__
|
|
#define __AP_HAL_LINUX_H__
|
|
|
|
/* Your layer exports should depend on AP_HAL.h ONLY. */
|
|
#include <AP_HAL/AP_HAL.h>
|
|
|
|
/**
|
|
* Umbrella header for AP_HAL_Linux module.
|
|
* The module header exports singleton instances which must conform the
|
|
* AP_HAL::HAL interface. It may only expose implementation details (class
|
|
* names, headers) via the Linux namespace.
|
|
* The class implementing AP_HAL::HAL should be called HAL_Linux and exist
|
|
* in the global namespace. There should be a single const instance of the
|
|
* HAL_Linux class called AP_HAL_Linux, instantiated in the HAL_Linux_Class.cpp
|
|
* and exported as `extern const HAL_Linux AP_HAL_Linux;` in HAL_Linux_Class.h
|
|
*
|
|
* All declaration and compilation should be guarded by CONFIG_HAL_BOARD macros.
|
|
* In this case, we're using CONFIG_HAL_BOARD == HAL_BOARD_LINUX.
|
|
* When creating a new HAL, declare a new HAL_BOARD_ in AP_HAL/AP_HAL_Boards.h
|
|
*
|
|
* The module should also export an appropriate AP_HAL_MAIN() macro iff the
|
|
* appropriate CONFIG_HAL_BOARD value is set.
|
|
* The AP_HAL_MAIN macro expands to a main function (either an `int main (void)`
|
|
* or `int main (int argc, const char * argv[]), depending on platform) of an
|
|
* ArduPilot application, whose entry points are the c++ functions
|
|
* `void setup()` and `void loop()`, ala Arduino.
|
|
*/
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
|
|
|
#include "HAL_Linux_Class.h"
|
|
#include "AP_HAL_Linux_Main.h"
|
|
|
|
#endif // CONFIG_HAL_BOARD
|
|
#endif //__AP_HAL_LINUX_H__
|
|
|