mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
Enable GPS module as "optional module" in CooterControl
This commit is contained in:
parent
dfd301571a
commit
53d0732fc6
@ -53,7 +53,8 @@
|
||||
|
||||
/* Supported USART-based PIOS modules */
|
||||
#define PIOS_INCLUDE_TELEMETRY_RF
|
||||
//#define PIOS_INCLUDE_GPS
|
||||
#define PIOS_INCLUDE_GPS
|
||||
#define PIOS_GPS_PURISTIC
|
||||
|
||||
#define PIOS_INCLUDE_SERVO
|
||||
#define PIOS_INCLUDE_SPI
|
||||
|
@ -526,6 +526,7 @@ static const struct pios_sbus_cfg pios_sbus_cfg = {
|
||||
#define PIOS_COM_TELEM_RF_TX_BUF_LEN 192
|
||||
|
||||
#define PIOS_COM_GPS_RX_BUF_LEN 96
|
||||
#define PIOS_COM_GPS_TX_BUF_LEN 16
|
||||
|
||||
#define PIOS_COM_TELEM_USB_RX_BUF_LEN 192
|
||||
#define PIOS_COM_TELEM_USB_TX_BUF_LEN 192
|
||||
@ -1035,10 +1036,12 @@ void PIOS_Board_Init(void) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
uint8_t * rx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_GPS_RX_BUF_LEN);
|
||||
uint8_t * tx_buffer = (uint8_t *) pvPortMalloc(PIOS_COM_GPS_TX_BUF_LEN);
|
||||
PIOS_Assert(rx_buffer);
|
||||
PIOS_Assert(tx_buffer);
|
||||
if (PIOS_COM_Init(&pios_com_gps_id, &pios_usart_com_driver, pios_usart_gps_id,
|
||||
rx_buffer, PIOS_COM_GPS_RX_BUF_LEN,
|
||||
NULL, 0)) {
|
||||
tx_buffer, PIOS_COM_GPS_TX_BUF_LEN)) {
|
||||
PIOS_Assert(0);
|
||||
}
|
||||
}
|
||||
|
@ -77,9 +77,9 @@ static float GravityAccel(float latitude, float longitude, float altitude);
|
||||
#endif
|
||||
#else
|
||||
#ifdef ENABLE_GPS_BINARY_GTOP
|
||||
#define STACK_SIZE_BYTES 440
|
||||
#define STACK_SIZE_BYTES 650
|
||||
#else
|
||||
#define STACK_SIZE_BYTES 440
|
||||
#define STACK_SIZE_BYTES 650
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -125,15 +125,18 @@ int32_t GPSStart(void)
|
||||
int32_t GPSInitialize(void)
|
||||
{
|
||||
GPSPositionInitialize();
|
||||
#if !defined(PIOS_GPS_PURISTIC)
|
||||
GPSTimeInitialize();
|
||||
HomeLocationInitialize();
|
||||
#endif
|
||||
|
||||
// TODO: Get gps settings object
|
||||
gpsPort = PIOS_COM_GPS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
MODULE_INITCALL(GPSInitialize, GPSStart)
|
||||
// optional module, gets initialized separately
|
||||
//MODULE_INITCALL(GPSInitialize, GPSStart)
|
||||
|
||||
// ****************
|
||||
/**
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <openpilot.h>
|
||||
#include <uavobjectsinit.h>
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "hwsettings.h"
|
||||
|
||||
//#define I2C_DEBUG_PIN 0
|
||||
//#define USART_GPS_DEBUG_PIN 1
|
||||
@ -1025,6 +1026,9 @@ void PIOS_Board_Init(void) {
|
||||
EventDispatcherInitialize();
|
||||
UAVObjInitialize();
|
||||
|
||||
HwSettingsInitialize();
|
||||
ManualControlSettingsInitialize();
|
||||
|
||||
#if defined(PIOS_INCLUDE_RTC)
|
||||
/* Initialize the real-time clock and its associated tick */
|
||||
PIOS_RTC_Init(&pios_rtc_main_cfg);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <openpilot.h>
|
||||
#include <uavobjectsinit.h>
|
||||
|
||||
#include "hwsettings.h"
|
||||
#include "attituderaw.h"
|
||||
#include "attitudeactual.h"
|
||||
#include "positionactual.h"
|
||||
@ -181,6 +182,7 @@ void PIOS_Board_Init(void) {
|
||||
AttitudeActualInitialize();
|
||||
VelocityActualInitialize();
|
||||
PositionActualInitialize();
|
||||
HwSettingsInitialize();
|
||||
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@ UAVOBJSRCFILENAMES += velocityactual
|
||||
UAVOBJSRCFILENAMES += velocitydesired
|
||||
UAVOBJSRCFILENAMES += watchdogstatus
|
||||
UAVOBJSRCFILENAMES += flightstatus
|
||||
UAVOBJSRCFILENAMES += hwsettings
|
||||
UAVOBJSRCFILENAMES += cameradesired
|
||||
UAVOBJSRCFILENAMES += camerastabsettings
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user