mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-04 12:24:11 +01:00
Sanity check: Add some initial checks for revo that make sure the needed optional modules are
running.
This commit is contained in:
parent
23422d3cd4
commit
736f96b297
@ -51,16 +51,13 @@ static int32_t check_stabilization_settings(int index, bool multirotor);
|
|||||||
int32_t configuration_check()
|
int32_t configuration_check()
|
||||||
{
|
{
|
||||||
int32_t status = SYSTEMALARMS_ALARM_OK;
|
int32_t status = SYSTEMALARMS_ALARM_OK;
|
||||||
// TODO: Check manual control settings for any modes that can be accessed without the
|
|
||||||
// necessary module running
|
|
||||||
|
|
||||||
// TODO: Get board type
|
// Get board type
|
||||||
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
const struct pios_board_info * bdinfo = &pios_board_info_blob;
|
||||||
bool coptercontrol = bdinfo->board_type == 0x04;
|
bool coptercontrol = bdinfo->board_type == 0x04;
|
||||||
|
|
||||||
// Classify airframe type
|
// Classify airframe type
|
||||||
bool multirotor = true;
|
bool multirotor = true;
|
||||||
|
|
||||||
uint8_t airframe_type;
|
uint8_t airframe_type;
|
||||||
SystemSettingsAirframeTypeGet(&airframe_type);
|
SystemSettingsAirframeTypeGet(&airframe_type);
|
||||||
switch(airframe_type) {
|
switch(airframe_type) {
|
||||||
@ -112,14 +109,29 @@ int32_t configuration_check()
|
|||||||
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_ALTITUDEHOLD:
|
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_ALTITUDEHOLD:
|
||||||
if (coptercontrol)
|
if (coptercontrol)
|
||||||
status = SYSTEMALARMS_ALARM_ERROR;
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
else {
|
||||||
|
// Revo supports altitude hold
|
||||||
|
if(running[TASKINFO_RUNNING_ALTITUDEHOLD] != TASKINFO_RUNNING_TRUE)
|
||||||
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_VELOCITYCONTROL:
|
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_VELOCITYCONTROL:
|
||||||
if (coptercontrol)
|
if (coptercontrol)
|
||||||
status = SYSTEMALARMS_ALARM_ERROR;
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
else {
|
||||||
|
// Revo supports altitude hold
|
||||||
|
if(running[TASKINFO_RUNNING_GUIDANCE] != TASKINFO_RUNNING_TRUE)
|
||||||
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_POSITIONHOLD:
|
case MANUALCONTROLSETTINGS_FLIGHTMODEPOSITION_POSITIONHOLD:
|
||||||
if (coptercontrol)
|
if (coptercontrol)
|
||||||
status = SYSTEMALARMS_ALARM_ERROR;
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
else {
|
||||||
|
// Revo supports altitude hold
|
||||||
|
if(running[TASKINFO_RUNNING_GUIDANCE] != TASKINFO_RUNNING_TRUE)
|
||||||
|
status = SYSTEMALARMS_ALARM_ERROR;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Uncovered modes are automatically an error
|
// Uncovered modes are automatically an error
|
||||||
|
Loading…
Reference in New Issue
Block a user