AP_HAL_AVR: move AP_HAL_MAIN into separate header

This commit is contained in:
Pat Hickey 2012-12-14 17:19:16 -08:00 committed by Andrew Tridgell
parent d18b9feaa1
commit 07be511f5e
2 changed files with 20 additions and 14 deletions

View File

@ -4,25 +4,15 @@
#include <AP_HAL.h>
#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__

View File

@ -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__