AP_HAL: remove support for main without argc
This was only used by flymaple. Also add missing copyright notice to header.
This commit is contained in:
parent
92411402b6
commit
bbe3a94175
@ -1,9 +1,24 @@
|
||||
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
#define CONFIG_MAIN_WITHOUT_ARGC_ARGV 0
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
||||
#define AP_MAIN __EXPORT ArduPilot_main
|
||||
#endif
|
||||
@ -12,27 +27,6 @@
|
||||
#define AP_MAIN main
|
||||
#endif
|
||||
|
||||
#if CONFIG_MAIN_WITHOUT_ARGC_ARGV
|
||||
|
||||
#define AP_HAL_MAIN() extern "C" { \
|
||||
int AP_MAIN(void); \
|
||||
int AP_MAIN(void) { \
|
||||
AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \
|
||||
hal.run(0, NULL, &callbacks); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define AP_HAL_MAIN_CALLBACKS(CALLBACKS) extern "C" { \
|
||||
int AP_MAIN(void); \
|
||||
int AP_MAIN(void) { \
|
||||
hal.run(0, NULL, CALLBACKS); \
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define AP_HAL_MAIN() \
|
||||
AP_HAL::HAL::FunCallbacks callbacks(setup, loop); \
|
||||
extern "C" { \
|
||||
@ -50,5 +44,3 @@
|
||||
return 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user