2016-05-23 10:01:02 -03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* This file is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-02-17 21:25:25 -04:00
|
|
|
#pragma once
|
2015-10-19 15:01:24 -03:00
|
|
|
|
|
|
|
#include "HAL.h"
|
|
|
|
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
|
|
|
#define AP_MAIN __EXPORT ArduPilot_main
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_MAIN
|
|
|
|
#define AP_MAIN main
|
|
|
|
#endif
|
|
|
|
|
2016-04-27 01:21:28 -03:00
|
|
|
#define AP_HAL_MAIN() \
|
|
|
|
AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \
|
|
|
|
extern "C" { \
|
2015-10-22 15:34:00 -03:00
|
|
|
int AP_MAIN(int argc, char* const argv[]); \
|
2015-10-19 15:01:24 -03:00
|
|
|
int AP_MAIN(int argc, char* const argv[]) { \
|
|
|
|
hal.run(argc, argv, &callbacks); \
|
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2015-10-19 15:05:54 -03:00
|
|
|
#define AP_HAL_MAIN_CALLBACKS(CALLBACKS) extern "C" { \
|
2015-10-22 15:34:00 -03:00
|
|
|
int AP_MAIN(int argc, char* const argv[]); \
|
2015-10-19 15:05:54 -03:00
|
|
|
int AP_MAIN(int argc, char* const argv[]) { \
|
|
|
|
hal.run(argc, argv, CALLBACKS); \
|
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
}
|