mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
Made OverSynce an optional module.
Conflicts: shared/uavobjectdefinition/hwsettings.xml
This commit is contained in:
parent
6e12054a08
commit
9eee4f1bc7
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "openpilot.h"
|
||||
#include "hwsettings.h"
|
||||
#include "overosync.h"
|
||||
#include "overosyncstats.h"
|
||||
#include "systemstats.h"
|
||||
@ -49,6 +50,7 @@ static UAVTalkConnection uavTalkCon;
|
||||
static xTaskHandle overoSyncTaskHandle;
|
||||
volatile bool buffer_swap_failed;
|
||||
volatile uint32_t buffer_swap_timeval;
|
||||
static bool overoEnabled;
|
||||
|
||||
// Private functions
|
||||
static void overoSyncTask(void *parameters);
|
||||
@ -140,6 +142,23 @@ int32_t OveroSyncInitialize(void)
|
||||
{
|
||||
if(pios_spi_overo_id == 0)
|
||||
return -1;
|
||||
|
||||
#ifdef MODULE_OVERO_BUILTIN
|
||||
overoEnabled = true;
|
||||
#else
|
||||
|
||||
HwSettingsInitialize();
|
||||
uint8_t optionalModules[HWSETTINGS_OPTIONALMODULES_NUMELEM];
|
||||
HwSettingsOptionalModulesGet(optionalModules);
|
||||
|
||||
if (optionalModules[HWSETTINGS_OPTIONALMODULES_OVERO] == HWSETTINGS_OPTIONALMODULES_ENABLED) {
|
||||
overoEnabled = true;
|
||||
} else {
|
||||
overoEnabled = false;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
OveroSyncStatsInitialize();
|
||||
|
||||
@ -160,6 +179,11 @@ int32_t OveroSyncInitialize(void)
|
||||
*/
|
||||
int32_t OveroSyncStart(void)
|
||||
{
|
||||
//Check if module is enabled or not
|
||||
if (overoEnabled == false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(pios_spi_overo_id == 0)
|
||||
return -1;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
<field name="USB_HIDPort" units="function" type="enum" elements="1" options="USBTelemetry,Disabled" defaultvalue="USBTelemetry"/>
|
||||
<field name="USB_VCPPort" units="function" type="enum" elements="1" options="USBTelemetry,ComBridge,Disabled" defaultvalue="Disabled"/>
|
||||
|
||||
<field name="OptionalModules" units="" type="enum" elementnames="CameraStab,GPS,ComUsbBridge,Fault,Altitude,Airspeed,TxPID,Battery,VtolPathFollower,FixedWingPathFollower" options="Disabled,Enabled" defaultvalue="Disabled"/>
|
||||
<field name="OptionalModules" units="" type="enum" elementnames="CameraStab,GPS,ComUsbBridge,Fault,Altitude,Airspeed,TxPID,VtolPathFollower,FixedWingPathFollower,Battery,Overo" options="Disabled,Enabled" defaultvalue="Disabled"/>
|
||||
<field name="DSMxBind" units="" type="uint8" elements="1" defaultvalue="0"/>
|
||||
|
||||
<access gcs="readwrite" flight="readwrite"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user