From 74ee70d463978b093547ad453c94eb15b6200987 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 Jul 2014 08:52:27 +1000 Subject: [PATCH] HAL_Linux: updates for ERLE board type --- libraries/AP_HAL/AP_HAL_Boards.h | 7 +++++++ libraries/AP_HAL_Linux/AP_HAL_Linux.h | 2 +- libraries/AP_HAL_Linux/AP_HAL_Linux_Main.h | 4 ++-- libraries/AP_HAL_Linux/AnalogIn.cpp | 2 +- libraries/AP_HAL_Linux/GPIO.cpp | 2 +- libraries/AP_HAL_Linux/HAL_Linux_Class.cpp | 2 +- libraries/AP_HAL_Linux/I2CDriver.cpp | 2 +- libraries/AP_HAL_Linux/RCInput.cpp | 2 +- libraries/AP_HAL_Linux/RCOutput.cpp | 2 +- libraries/AP_HAL_Linux/SPIDriver.cpp | 2 +- libraries/AP_HAL_Linux/Scheduler.cpp | 2 +- libraries/AP_HAL_Linux/Scheduler.h | 2 +- libraries/AP_HAL_Linux/Semaphores.cpp | 2 +- libraries/AP_HAL_Linux/Semaphores.h | 2 +- libraries/AP_HAL_Linux/Storage.cpp | 2 +- libraries/AP_HAL_Linux/UARTDriver.cpp | 2 +- libraries/AP_HAL_Linux/Util.cpp | 4 ++-- 17 files changed, 25 insertions(+), 18 deletions(-) diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index 368c99affc..8e73fb1689 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -18,6 +18,7 @@ #define HAL_BOARD_FLYMAPLE 6 #define HAL_BOARD_LINUX 7 #define HAL_BOARD_VRBRAIN 8 +#define HAL_BOARD_ERLE 9 #define HAL_BOARD_EMPTY 99 @@ -95,6 +96,12 @@ #define HAL_STORAGE_SIZE 4096 #define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE +#elif CONFIG_HAL_BOARD == HAL_BOARD_ERLE +#define AP_HAL_BOARD_DRIVER AP_HAL_Linux +#define HAL_BOARD_NAME "Erle Linux" +#define HAL_CPU_CLASS HAL_CPU_CLASS_1000 +#define HAL_OS_POSIX_IO 1 + #elif CONFIG_HAL_BOARD == HAL_BOARD_EMPTY #define AP_HAL_BOARD_DRIVER AP_HAL_Empty #define HAL_BOARD_NAME "EMPTY" diff --git a/libraries/AP_HAL_Linux/AP_HAL_Linux.h b/libraries/AP_HAL_Linux/AP_HAL_Linux.h index 16f4f44fec..1b25167647 100644 --- a/libraries/AP_HAL_Linux/AP_HAL_Linux.h +++ b/libraries/AP_HAL_Linux/AP_HAL_Linux.h @@ -27,7 +27,7 @@ * `void setup()` and `void loop()`, ala Arduino. */ -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "HAL_Linux_Class.h" #include "AP_HAL_Linux_Main.h" diff --git a/libraries/AP_HAL_Linux/AP_HAL_Linux_Main.h b/libraries/AP_HAL_Linux/AP_HAL_Linux_Main.h index 19bf66cd06..6c35350580 100644 --- a/libraries/AP_HAL_Linux/AP_HAL_Linux_Main.h +++ b/libraries/AP_HAL_Linux/AP_HAL_Linux_Main.h @@ -3,7 +3,7 @@ #ifndef __AP_HAL_LINUX_MAIN_H__ #define __AP_HAL_LINUX_MAIN_H__ -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #define AP_HAL_MAIN() extern "C" {\ int main (int argc, char * const argv[]) { \ hal.init(argc, argv); \ @@ -14,6 +14,6 @@ int main (int argc, char * const argv[]) { \ return 0;\ }\ } -#endif // HAL_BOARD_LINUX +#endif // HAL_BOARD_LINUX || HAL_BOARD_ERLE #endif // __AP_HAL_LINUX_MAIN_H__ diff --git a/libraries/AP_HAL_Linux/AnalogIn.cpp b/libraries/AP_HAL_Linux/AnalogIn.cpp index f919b62c14..aa3b7f0b4c 100644 --- a/libraries/AP_HAL_Linux/AnalogIn.cpp +++ b/libraries/AP_HAL_Linux/AnalogIn.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "AnalogIn.h" using namespace Linux; diff --git a/libraries/AP_HAL_Linux/GPIO.cpp b/libraries/AP_HAL_Linux/GPIO.cpp index 57f8d95ae8..c39f0ce5d5 100644 --- a/libraries/AP_HAL_Linux/GPIO.cpp +++ b/libraries/AP_HAL_Linux/GPIO.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "GPIO.h" diff --git a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp index 0d0326dccf..c02f708e9a 100644 --- a/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp +++ b/libraries/AP_HAL_Linux/HAL_Linux_Class.cpp @@ -1,5 +1,5 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "HAL_Linux_Class.h" #include "AP_HAL_Linux_Private.h" diff --git a/libraries/AP_HAL_Linux/I2CDriver.cpp b/libraries/AP_HAL_Linux/I2CDriver.cpp index 151e383a44..f553e7af8b 100644 --- a/libraries/AP_HAL_Linux/I2CDriver.cpp +++ b/libraries/AP_HAL_Linux/I2CDriver.cpp @@ -1,7 +1,7 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "I2CDriver.h" #include diff --git a/libraries/AP_HAL_Linux/RCInput.cpp b/libraries/AP_HAL_Linux/RCInput.cpp index 7abac33bb4..8775bad751 100644 --- a/libraries/AP_HAL_Linux/RCInput.cpp +++ b/libraries/AP_HAL_Linux/RCInput.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "RCInput.h" diff --git a/libraries/AP_HAL_Linux/RCOutput.cpp b/libraries/AP_HAL_Linux/RCOutput.cpp index 5a03d1ee27..8cb144b20f 100644 --- a/libraries/AP_HAL_Linux/RCOutput.cpp +++ b/libraries/AP_HAL_Linux/RCOutput.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "RCOutput.h" diff --git a/libraries/AP_HAL_Linux/SPIDriver.cpp b/libraries/AP_HAL_Linux/SPIDriver.cpp index 2da5e02c13..9c5b3b92fa 100644 --- a/libraries/AP_HAL_Linux/SPIDriver.cpp +++ b/libraries/AP_HAL_Linux/SPIDriver.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "SPIDriver.h" #include #include diff --git a/libraries/AP_HAL_Linux/Scheduler.cpp b/libraries/AP_HAL_Linux/Scheduler.cpp index efd5991da8..6ef390ae4e 100644 --- a/libraries/AP_HAL_Linux/Scheduler.cpp +++ b/libraries/AP_HAL_Linux/Scheduler.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "Scheduler.h" #include "Storage.h" diff --git a/libraries/AP_HAL_Linux/Scheduler.h b/libraries/AP_HAL_Linux/Scheduler.h index 0e86a689e2..8d5064f172 100644 --- a/libraries/AP_HAL_Linux/Scheduler.h +++ b/libraries/AP_HAL_Linux/Scheduler.h @@ -4,7 +4,7 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include #include diff --git a/libraries/AP_HAL_Linux/Semaphores.cpp b/libraries/AP_HAL_Linux/Semaphores.cpp index 5b6a918ab7..5b6f4a475d 100644 --- a/libraries/AP_HAL_Linux/Semaphores.cpp +++ b/libraries/AP_HAL_Linux/Semaphores.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "Semaphores.h" diff --git a/libraries/AP_HAL_Linux/Semaphores.h b/libraries/AP_HAL_Linux/Semaphores.h index 7828cbf0e1..c39b2d884c 100644 --- a/libraries/AP_HAL_Linux/Semaphores.h +++ b/libraries/AP_HAL_Linux/Semaphores.h @@ -4,7 +4,7 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include #include diff --git a/libraries/AP_HAL_Linux/Storage.cpp b/libraries/AP_HAL_Linux/Storage.cpp index 23b1ed8900..ec428dba97 100644 --- a/libraries/AP_HAL_Linux/Storage.cpp +++ b/libraries/AP_HAL_Linux/Storage.cpp @@ -1,5 +1,5 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include #include diff --git a/libraries/AP_HAL_Linux/UARTDriver.cpp b/libraries/AP_HAL_Linux/UARTDriver.cpp index ab3ee726ca..7089a92295 100644 --- a/libraries/AP_HAL_Linux/UARTDriver.cpp +++ b/libraries/AP_HAL_Linux/UARTDriver.cpp @@ -1,6 +1,6 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include "UARTDriver.h" diff --git a/libraries/AP_HAL_Linux/Util.cpp b/libraries/AP_HAL_Linux/Util.cpp index c0b075f351..94c817545b 100644 --- a/libraries/AP_HAL_Linux/Util.cpp +++ b/libraries/AP_HAL_Linux/Util.cpp @@ -1,5 +1,5 @@ #include -#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE #include #include #include @@ -20,4 +20,4 @@ void LinuxUtil::commandline_arguments(uint8_t &argc, char * const *&argv) argv = saved_argv; } -#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#endif // CONFIG_HAL_BOARD == HAL_BOARD_LINUX || CONFIG_HAL_BOARD == HAL_BOARD_ERLE