1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-16 08:29:15 +01:00

LP-97 - Move board init function declarations to a pios_board_init.h, fix some headers

This commit is contained in:
Alessio Morale 2015-11-08 18:44:10 +01:00
parent 970ae3df00
commit 70faa04b0a
18 changed files with 49 additions and 28 deletions

View File

@ -61,6 +61,8 @@
#include <pios_flashfs.h> #include <pios_flashfs.h>
#include <pios_notify.h> #include <pios_notify.h>
#include <pios_task_monitor.h> #include <pios_task_monitor.h>
#include <pios_board_init.h>
#ifdef PIOS_INCLUDE_INSTRUMENTATION #ifdef PIOS_INCLUDE_INSTRUMENTATION
#include <instrumentation.h> #include <instrumentation.h>
@ -120,7 +122,6 @@ static void systemTask(void *parameters);
static void updateI2Cstats(); static void updateI2Cstats();
static void updateWDGstats(); static void updateWDGstats();
#endif #endif
extern void PIOS_Board_Init(void);
extern uintptr_t pios_uavo_settings_fs_id; extern uintptr_t pios_uavo_settings_fs_id;
extern uintptr_t pios_user_fs_id; extern uintptr_t pios_user_fs_id;

View File

@ -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 */

View File

@ -33,9 +33,8 @@
#include <pios_iap.h> #include <pios_iap.h>
#include <fifo_buffer.h> #include <fifo_buffer.h>
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -155,7 +155,6 @@ static const struct pios_mpu6000_cfg pios_mpu6000_cfg = {
int32_t init_test; int32_t init_test;
void PIOS_Board_Init(void) void PIOS_Board_Init(void)
{ {
const struct pios_board_info *bdinfo = &pios_board_info_blob; const struct pios_board_info *bdinfo = &pios_board_info_blob;
#if defined(PIOS_INCLUDE_LED) #if defined(PIOS_INCLUDE_LED)

View File

@ -34,9 +34,8 @@
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_usbhook.h> /* PIOS_USBHOOK_* */ #include <pios_usbhook.h> /* PIOS_USBHOOK_* */
#include <stdbool.h> #include <stdbool.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
void check_bor(); void check_bor();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -36,9 +36,8 @@
#include <pios_com.h> #include <pios_com.h>
#include <ssp.h> #include <ssp.h>
#include <pios_delay.h> #include <pios_delay.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
int32_t platform_senddata(const uint8_t *msg, uint16_t msg_len); int32_t platform_senddata(const uint8_t *msg, uint16_t msg_len);
/* Private typedef -----------------------------------------------------------*/ /* Private typedef -----------------------------------------------------------*/

View File

@ -34,14 +34,13 @@
#include "inc/openpilot.h" #include "inc/openpilot.h"
#include <uavobjectsinit.h> #include <uavobjectsinit.h>
#include <hwsettings.h> #include <hwsettings.h>
#include <pios_board_init.h>
/* Task Priorities */ /* Task Priorities */
#define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3) #define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3)
/* Global Variables */ /* Global Variables */
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void Stack_Change(void); extern void Stack_Change(void);
/** /**

View File

@ -33,9 +33,8 @@
#include <pios_iap.h> #include <pios_iap.h>
#include <fifo_buffer.h> #include <fifo_buffer.h>
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -34,14 +34,13 @@
#include "inc/openpilot.h" #include "inc/openpilot.h"
#include <uavobjectsinit.h> #include <uavobjectsinit.h>
#include <hwsettings.h> #include <hwsettings.h>
#include <pios_board_init.h>
/* Task Priorities */ /* Task Priorities */
#define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3) #define PRIORITY_TASK_HOOKS (tskIDLE_PRIORITY + 3)
/* Global Variables */ /* Global Variables */
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void Stack_Change(void); extern void Stack_Change(void);
/** /**

View File

@ -34,9 +34,8 @@
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_usbhook.h> /* PIOS_USBHOOK_* */ #include <pios_usbhook.h> /* PIOS_USBHOOK_* */
#include <stdbool.h> #include <stdbool.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -3,7 +3,7 @@
* @addtogroup LibrePilotSystem LibrePilot System * @addtogroup LibrePilotSystem LibrePilot System
* @brief These files are the core system files for Revolution. * @brief These files are the core system files for Revolution.
* They are the ground layer just above PiOS. In practice, OSD actually starts * 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 * @addtogroup LibrePilotCore LibrePilot Core
* @brief This is where the LP firmware starts. Those files also define the compile-time * @brief This is where the LP firmware starts. Those files also define the compile-time

View File

@ -34,9 +34,8 @@
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_usbhook.h> /* PIOS_USBHOOK_* */ #include <pios_usbhook.h> /* PIOS_USBHOOK_* */
#include <stdbool.h> #include <stdbool.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
void check_bor(); void check_bor();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -3,7 +3,7 @@
* @addtogroup LibrePilotSystem LibrePilot System * @addtogroup LibrePilotSystem LibrePilot System
* @brief These files are the core system files for Revolution. * @brief These files are the core system files for Revolution.
* They are the ground layer just above PiOS. In practice, Revolution actually starts * 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 * @addtogroup LibrePilotCore LibrePilot Core
* @brief This is where the LP firmware starts. Those files also define the compile-time * @brief This is where the LP firmware starts. Those files also define the compile-time

View File

@ -34,9 +34,8 @@
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_usbhook.h> /* PIOS_USBHOOK_* */ #include <pios_usbhook.h> /* PIOS_USBHOOK_* */
#include <stdbool.h> #include <stdbool.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
void check_bor(); void check_bor();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -3,7 +3,7 @@
* @addtogroup LibrePilotSystem LibrePilot System * @addtogroup LibrePilotSystem LibrePilot System
* @brief These files are the core system files for Revolution. * @brief These files are the core system files for Revolution.
* They are the ground layer just above PiOS. In practice, Revolution actually starts * 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 * @addtogroup LibrePilotCore LibrePilot Core
* @brief This is where the LP firmware starts. Those files also define the compile-time * @brief This is where the LP firmware starts. Those files also define the compile-time

View File

@ -34,9 +34,8 @@
#include <pios_com_msg.h> #include <pios_com_msg.h>
#include <pios_usbhook.h> /* PIOS_USBHOOK_* */ #include <pios_usbhook.h> /* PIOS_USBHOOK_* */
#include <stdbool.h> #include <stdbool.h>
#include <pios_board_init.h>
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
void check_bor(); void check_bor();
#define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1) #define BSL_HOLD_STATE ((PIOS_USB_DETECT_GPIO_PORT->IDR & PIOS_USB_DETECT_GPIO_PIN) ? 0 : 1)

View File

@ -3,7 +3,7 @@
* @addtogroup LibrePilotSystem LibrePilot System * @addtogroup LibrePilotSystem LibrePilot System
* @brief These files are the core system files for Revolution. * @brief These files are the core system files for Revolution.
* They are the ground layer just above PiOS. In practice, Revolution actually starts * 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 * @addtogroup LibrePilotCore LibrePilot Core
* @brief This is where the LP firmware starts. Those files also define the compile-time * @brief This is where the LP firmware starts. Those files also define the compile-time

View File

@ -30,10 +30,10 @@
#include <pios_board_info.h> #include <pios_board_info.h>
#include <stdbool.h> #include <stdbool.h>
#include <pios_bl_helper.h> #include <pios_bl_helper.h>
#include <pios_board_init.h>
#define MAX_WRI_RETRYS 3 #define MAX_WRI_RETRYS 3
/* Prototype of PIOS_Board_Init() function */
extern void PIOS_Board_Init(void);
extern void FLASH_Download(); extern void FLASH_Download();
void error(int, int); void error(int, int);