From 07be511f5e8ee5689785e550a6d9469d3e4f783b Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 14 Dec 2012 17:19:16 -0800 Subject: [PATCH] AP_HAL_AVR: move AP_HAL_MAIN into separate header --- libraries/AP_HAL_AVR/AP_HAL_AVR.h | 18 ++++-------------- libraries/AP_HAL_AVR/AP_HAL_AVR_Main.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 libraries/AP_HAL_AVR/AP_HAL_AVR_Main.h diff --git a/libraries/AP_HAL_AVR/AP_HAL_AVR.h b/libraries/AP_HAL_AVR/AP_HAL_AVR.h index 5e2b6f0b9a..28e479ed0a 100644 --- a/libraries/AP_HAL_AVR/AP_HAL_AVR.h +++ b/libraries/AP_HAL_AVR/AP_HAL_AVR.h @@ -4,25 +4,15 @@ #include -#include "HAL_AVR_APM1_Class.h" -#include "HAL_AVR_APM2_Class.h" - /** - * This module exports AP_HAL instances only. + * This module exports AP_HAL::HAL instances only. * All internal drivers must conform to AP_HAL interfaces * and not expose implementation details. */ -#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 -#define AP_HAL_MAIN() extern "C" {\ - int main (void) {\ - hal.init(0, NULL); \ - setup();\ - for(;;) loop();\ - return 0;\ - }\ - } -#endif +#include "HAL_AVR_APM1_Class.h" +#include "HAL_AVR_APM2_Class.h" +#include "AP_HAL_AVR_Main.h" #endif // __AP_HAL_AVR_H__ diff --git a/libraries/AP_HAL_AVR/AP_HAL_AVR_Main.h b/libraries/AP_HAL_AVR/AP_HAL_AVR_Main.h new file mode 100644 index 0000000000..3d3fcd9095 --- /dev/null +++ b/libraries/AP_HAL_AVR/AP_HAL_AVR_Main.h @@ -0,0 +1,16 @@ + +#ifndef __AP_HAL_AVR_MAIN_H__ +#define __AP_HAL_AVR_MAIN_H__ + +#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 +#define AP_HAL_MAIN() extern "C" {\ + int main (void) {\ + hal.init(0, NULL); \ + setup();\ + for(;;) loop();\ + return 0;\ + }\ + } +#endif + +#endif // __AP_HAL_AVR_MAIN_H__