diff --git a/flight/modules/System/systemmod.c b/flight/modules/System/systemmod.c index 11c4a2b69..aec2af33c 100644 --- a/flight/modules/System/systemmod.c +++ b/flight/modules/System/systemmod.c @@ -61,6 +61,8 @@ #include #include #include +#include + #ifdef PIOS_INCLUDE_INSTRUMENTATION #include @@ -120,7 +122,6 @@ static void systemTask(void *parameters); static void updateI2Cstats(); static void updateWDGstats(); #endif -extern void PIOS_Board_Init(void); extern uintptr_t pios_uavo_settings_fs_id; extern uintptr_t pios_user_fs_id; diff --git a/flight/pios/inc/pios_board_init.h b/flight/pios/inc/pios_board_init.h new file mode 100644 index 000000000..27b26a23a --- /dev/null +++ b/flight/pios/inc/pios_board_init.h @@ -0,0 +1,31 @@ +/** + ****************************************************************************** + * + * @file pios_board_init.h + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015. + * @brief board initialization prototypes + * -- + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program 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 program 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, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef PIOS_BOARD_INIT_H +#define PIOS_BOARD_INIT_H + +extern void PIOS_Board_Init(void); + +#endif /* PIOS_BOARD_INIT_H */ diff --git a/flight/targets/boards/coptercontrol/bootloader/main.c b/flight/targets/boards/coptercontrol/bootloader/main.c index 15068627c..20549d1fa 100644 --- a/flight/targets/boards/coptercontrol/bootloader/main.c +++ b/flight/targets/boards/coptercontrol/bootloader/main.c @@ -33,9 +33,8 @@ #include #include #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/coptercontrol/firmware/pios_board.c b/flight/targets/boards/coptercontrol/firmware/pios_board.c index bda24996b..baa17c0b3 100644 --- a/flight/targets/boards/coptercontrol/firmware/pios_board.c +++ b/flight/targets/boards/coptercontrol/firmware/pios_board.c @@ -155,7 +155,6 @@ static const struct pios_mpu6000_cfg pios_mpu6000_cfg = { int32_t init_test; void PIOS_Board_Init(void) { - const struct pios_board_info *bdinfo = &pios_board_info_blob; #if defined(PIOS_INCLUDE_LED) diff --git a/flight/targets/boards/discoveryf4bare/bootloader/main.c b/flight/targets/boards/discoveryf4bare/bootloader/main.c index 5c6e08db7..09a54a094 100644 --- a/flight/targets/boards/discoveryf4bare/bootloader/main.c +++ b/flight/targets/boards/discoveryf4bare/bootloader/main.c @@ -34,9 +34,8 @@ #include #include /* PIOS_USBHOOK_* */ #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); void check_bor(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/gpsplatinum/bootloader/main.c b/flight/targets/boards/gpsplatinum/bootloader/main.c index 2e2230847..a11fa2f3d 100644 --- a/flight/targets/boards/gpsplatinum/bootloader/main.c +++ b/flight/targets/boards/gpsplatinum/bootloader/main.c @@ -36,9 +36,8 @@ #include #include #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); int32_t platform_senddata(const uint8_t *msg, uint16_t msg_len); /* Private typedef -----------------------------------------------------------*/ diff --git a/flight/targets/boards/gpsplatinum/firmware/gpsp.c b/flight/targets/boards/gpsplatinum/firmware/gpsp.c index b240febb2..0768c2a55 100644 --- a/flight/targets/boards/gpsplatinum/firmware/gpsp.c +++ b/flight/targets/boards/gpsplatinum/firmware/gpsp.c @@ -34,14 +34,13 @@ #include "inc/openpilot.h" #include #include +#include /* Task Priorities */ #define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3) /* Global Variables */ -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void Stack_Change(void); /** diff --git a/flight/targets/boards/oplinkmini/bootloader/main.c b/flight/targets/boards/oplinkmini/bootloader/main.c index 9135341af..28cfcc30b 100644 --- a/flight/targets/boards/oplinkmini/bootloader/main.c +++ b/flight/targets/boards/oplinkmini/bootloader/main.c @@ -33,9 +33,8 @@ #include #include #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/oplinkmini/firmware/oplink.c b/flight/targets/boards/oplinkmini/firmware/oplink.c index 07d4fa551..13b5e44b3 100644 --- a/flight/targets/boards/oplinkmini/firmware/oplink.c +++ b/flight/targets/boards/oplinkmini/firmware/oplink.c @@ -34,14 +34,13 @@ #include "inc/openpilot.h" #include #include +#include /* Task Priorities */ #define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3) /* Global Variables */ -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void Stack_Change(void); /** diff --git a/flight/targets/boards/osd/bootloader/main.c b/flight/targets/boards/osd/bootloader/main.c index 12f2a4c39..c333ab9af 100644 --- a/flight/targets/boards/osd/bootloader/main.c +++ b/flight/targets/boards/osd/bootloader/main.c @@ -34,9 +34,8 @@ #include #include /* PIOS_USBHOOK_* */ #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/osd/firmware/osd.cpp b/flight/targets/boards/osd/firmware/osd.cpp index c35669129..417b6d7b2 100644 --- a/flight/targets/boards/osd/firmware/osd.cpp +++ b/flight/targets/boards/osd/firmware/osd.cpp @@ -3,7 +3,7 @@ * @addtogroup LibrePilotSystem LibrePilot System * @brief These files are the core system files for Revolution. * They are the ground layer just above PiOS. In practice, OSD actually starts - * in the main() function of osd.c + * in the main() function of osd.cpp * @{ * @addtogroup LibrePilotCore LibrePilot Core * @brief This is where the LP firmware starts. Those files also define the compile-time diff --git a/flight/targets/boards/revolution/bootloader/main.c b/flight/targets/boards/revolution/bootloader/main.c index 5c6e08db7..09a54a094 100644 --- a/flight/targets/boards/revolution/bootloader/main.c +++ b/flight/targets/boards/revolution/bootloader/main.c @@ -34,9 +34,8 @@ #include #include /* PIOS_USBHOOK_* */ #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); void check_bor(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/revolution/firmware/revolution.cpp b/flight/targets/boards/revolution/firmware/revolution.cpp index 0fd335f60..8c5bbf28c 100644 --- a/flight/targets/boards/revolution/firmware/revolution.cpp +++ b/flight/targets/boards/revolution/firmware/revolution.cpp @@ -3,7 +3,7 @@ * @addtogroup LibrePilotSystem LibrePilot System * @brief These files are the core system files for Revolution. * They are the ground layer just above PiOS. In practice, Revolution actually starts - * in the main() function of revolution.c + * in the main() function of revolution.cpp * @{ * @addtogroup LibrePilotCore LibrePilot Core * @brief This is where the LP firmware starts. Those files also define the compile-time diff --git a/flight/targets/boards/revonano/bootloader/main.c b/flight/targets/boards/revonano/bootloader/main.c index 5c6e08db7..09a54a094 100644 --- a/flight/targets/boards/revonano/bootloader/main.c +++ b/flight/targets/boards/revonano/bootloader/main.c @@ -34,9 +34,8 @@ #include #include /* PIOS_USBHOOK_* */ #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); void check_bor(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/revonano/firmware/revolution.cpp b/flight/targets/boards/revonano/firmware/revolution.cpp index 0fd335f60..8c5bbf28c 100644 --- a/flight/targets/boards/revonano/firmware/revolution.cpp +++ b/flight/targets/boards/revonano/firmware/revolution.cpp @@ -3,7 +3,7 @@ * @addtogroup LibrePilotSystem LibrePilot System * @brief These files are the core system files for Revolution. * They are the ground layer just above PiOS. In practice, Revolution actually starts - * in the main() function of revolution.c + * in the main() function of revolution.cpp * @{ * @addtogroup LibrePilotCore LibrePilot Core * @brief This is where the LP firmware starts. Those files also define the compile-time diff --git a/flight/targets/boards/revoproto/bootloader/main.c b/flight/targets/boards/revoproto/bootloader/main.c index 5c6e08db7..09a54a094 100644 --- a/flight/targets/boards/revoproto/bootloader/main.c +++ b/flight/targets/boards/revoproto/bootloader/main.c @@ -34,9 +34,8 @@ #include #include /* PIOS_USBHOOK_* */ #include +#include -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); extern void FLASH_Download(); void check_bor(); #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) diff --git a/flight/targets/boards/revoproto/firmware/revolution.cpp b/flight/targets/boards/revoproto/firmware/revolution.cpp index 0fd335f60..8c5bbf28c 100644 --- a/flight/targets/boards/revoproto/firmware/revolution.cpp +++ b/flight/targets/boards/revoproto/firmware/revolution.cpp @@ -3,7 +3,7 @@ * @addtogroup LibrePilotSystem LibrePilot System * @brief These files are the core system files for Revolution. * They are the ground layer just above PiOS. In practice, Revolution actually starts - * in the main() function of revolution.c + * in the main() function of revolution.cpp * @{ * @addtogroup LibrePilotCore LibrePilot Core * @brief This is where the LP firmware starts. Those files also define the compile-time diff --git a/flight/targets/common/bootloader_updater/main.c b/flight/targets/common/bootloader_updater/main.c index 385bbdd3d..1a480afa5 100644 --- a/flight/targets/common/bootloader_updater/main.c +++ b/flight/targets/common/bootloader_updater/main.c @@ -30,10 +30,10 @@ #include #include #include +#include #define MAX_WRI_RETRYS 3 -/* Prototype of PIOS_Board_Init() function */ -extern void PIOS_Board_Init(void); + extern void FLASH_Download(); void error(int, int);