mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-17 02:52:12 +01:00
moved sanitycheck from system to manualcontrol to not break OSD and PipX
targets Conflicts: flight/Modules/ManualControl/manualcontrol.c
This commit is contained in:
parent
40381d98ae
commit
35509ee977
@ -34,6 +34,7 @@
|
||||
*/
|
||||
|
||||
#include "openpilot.h"
|
||||
#include "sanitycheck.h"
|
||||
#include "manualcontrol.h"
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "stabilizationsettings.h"
|
||||
@ -47,6 +48,7 @@
|
||||
#include "altitudeholddesired.h"
|
||||
#include "positionactual.h"
|
||||
#include "baroaltitude.h"
|
||||
#include "systemsettings.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_USB_RCTX)
|
||||
#include "pios_usb_rctx.h"
|
||||
@ -89,6 +91,7 @@ static void altitudeHoldDesired(ManualControlCommandData * cmd);
|
||||
static void processFlightMode(ManualControlSettingsData * settings, float flightMode);
|
||||
static void processArm(ManualControlCommandData * cmd, ManualControlSettingsData * settings);
|
||||
static void setArmedIfChanged(uint8_t val);
|
||||
static void configurationUpdatedCb(UAVObjEvent * ev);
|
||||
|
||||
static void manualControlTask(void *parameters);
|
||||
static float scaleChannel(int16_t value, int16_t max, int16_t min, int16_t neutral);
|
||||
@ -163,6 +166,15 @@ static void manualControlTask(void *parameters)
|
||||
AccessoryDesiredCreateInstance();
|
||||
AccessoryDesiredCreateInstance();
|
||||
|
||||
// Run this initially to make sure the configuration is checked
|
||||
configuration_check();
|
||||
|
||||
// Whenever the configuration changes, make sure it is safe to fly
|
||||
SystemSettingsConnectCallback(configurationUpdatedCb);
|
||||
ManualControlSettingsConnectCallback(configurationUpdatedCb);
|
||||
|
||||
// Whenever the configuration changes, make sure it is safe to fly
|
||||
|
||||
// Make sure unarmed on power up
|
||||
ManualControlCommandGet(&cmd);
|
||||
FlightStatusGet(&flightStatus);
|
||||
@ -924,6 +936,17 @@ static void applyDeadband(float *value, float deadband)
|
||||
*value += deadband;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called whenever a critical configuration component changes
|
||||
*/
|
||||
static void configurationUpdatedCb(UAVObjEvent * ev)
|
||||
{
|
||||
configuration_check();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
@ -40,10 +40,8 @@
|
||||
|
||||
#include "openpilot.h"
|
||||
#include "systemmod.h"
|
||||
#include "sanitycheck.h"
|
||||
#include "objectpersistence.h"
|
||||
#include "flightstatus.h"
|
||||
#include "manualcontrolsettings.h"
|
||||
#include "systemstats.h"
|
||||
#include "systemsettings.h"
|
||||
#include "i2cstats.h"
|
||||
@ -90,7 +88,6 @@ static bool mallocFailed;
|
||||
|
||||
// Private functions
|
||||
static void objectUpdatedCb(UAVObjEvent * ev);
|
||||
static void configurationUpdatedCb(UAVObjEvent * ev);
|
||||
static void hwSettingsUpdatedCb(UAVObjEvent * ev);
|
||||
static void updateStats();
|
||||
static void updateSystemAlarms();
|
||||
@ -174,12 +171,7 @@ static void systemTask(void *parameters)
|
||||
// Listen for SettingPersistance object updates, connect a callback function
|
||||
ObjectPersistenceConnectQueue(objectPersistenceQueue);
|
||||
|
||||
// Run this initially to make sure the configuration is checked
|
||||
configuration_check();
|
||||
|
||||
// Whenever the configuration changes, make sure it is safe to fly
|
||||
SystemSettingsConnectCallback(configurationUpdatedCb);
|
||||
ManualControlSettingsConnectCallback(configurationUpdatedCb);
|
||||
HwSettingsConnectCallback(hwSettingsUpdatedCb);
|
||||
|
||||
// Main system loop
|
||||
@ -320,14 +312,6 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever a critical configuration component changes
|
||||
*/
|
||||
static void configurationUpdatedCb(UAVObjEvent * ev)
|
||||
{
|
||||
configuration_check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever hardware settings changed
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user