Allow gyro-less booting
This commit is contained in:
parent
b9f533abe3
commit
adee15a806
|
@ -2711,7 +2711,7 @@ static void cliStatus(char *cmdline)
|
|||
const int systemRate = getTaskDeltaTime(TASK_SYSTEM) == 0 ? 0 : (int)(1000000.0f / ((float)getTaskDeltaTime(TASK_SYSTEM)));
|
||||
cliPrintLinef("CPU:%d%%, cycle time: %d, GYRO rate: %d, RX rate: %d, System rate: %d",
|
||||
constrain(averageSystemLoadPercent, 0, 100), getTaskDeltaTime(TASK_GYROPID), gyroRate, rxRate, systemRate);
|
||||
|
||||
cliPrintLinef("Arming disable flags: 0x%x", getArmingDisableFlags() & ~ARMING_DISABLED_CLI);
|
||||
}
|
||||
|
||||
#ifndef SKIP_TASK_STATISTICS
|
||||
|
|
|
@ -478,8 +478,8 @@ void init(void)
|
|||
initBoardAlignment(boardAlignment());
|
||||
|
||||
if (!sensorsAutodetect()) {
|
||||
// if gyro was not detected due to whatever reason, we give up now.
|
||||
failureMode(FAILURE_MISSING_ACC);
|
||||
// if gyro was not detected due to whatever reason, don't arm.
|
||||
setArmingDisabled(ARMING_DISABLED_NO_GYRO);
|
||||
}
|
||||
|
||||
systemState |= SYSTEM_STATE_SENSORS_READY;
|
||||
|
|
|
@ -259,8 +259,11 @@ void osdSlaveTasksInit(void)
|
|||
void fcTasksInit(void)
|
||||
{
|
||||
schedulerInit();
|
||||
rescheduleTask(TASK_GYROPID, gyro.targetLooptime);
|
||||
setTaskEnabled(TASK_GYROPID, true);
|
||||
|
||||
if (sensors(SENSOR_GYRO)) {
|
||||
rescheduleTask(TASK_GYROPID, gyro.targetLooptime);
|
||||
setTaskEnabled(TASK_GYROPID, true);
|
||||
}
|
||||
|
||||
if (sensors(SENSOR_ACC)) {
|
||||
setTaskEnabled(TASK_ACCEL, true);
|
||||
|
|
|
@ -46,6 +46,11 @@ bool isArmingDisabled()
|
|||
return armingDisableFlags;
|
||||
}
|
||||
|
||||
armingDisableFlags_e getArmingDisableFlags(void)
|
||||
{
|
||||
return armingDisableFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the given flight mode. A beep is sounded if the flight mode
|
||||
* has changed. Returns the new 'flightModeFlags' value.
|
||||
|
|
|
@ -40,11 +40,13 @@ typedef enum {
|
|||
ARMING_DISABLED_CMS_MENU = (1 << 7),
|
||||
ARMING_DISABLED_OSD_MENU = (1 << 8),
|
||||
ARMING_DISABLED_BST = (1 << 9),
|
||||
ARMING_DISABLED_NO_GYRO = (1 << 10),
|
||||
} armingDisableFlags_e;
|
||||
|
||||
void setArmingDisabled(armingDisableFlags_e flag);
|
||||
void unsetArmingDisabled(armingDisableFlags_e flag);
|
||||
bool isArmingDisabled(void);
|
||||
armingDisableFlags_e getArmingDisableFlags(void);
|
||||
|
||||
typedef enum {
|
||||
ANGLE_MODE = (1 << 0),
|
||||
|
|
Loading…
Reference in New Issue