2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
21 //#define DEBUG_RC_CONTROLS
26 #include "common/maths.h"
27 #include "common/axis.h"
28 #include "common/bitarray.h"
31 #include "pg/pg_ids.h"
34 #include "blackbox/blackbox.h"
35 #include "blackbox/blackbox_fielddefs.h"
37 #include "drivers/sensor.h"
39 #include "sensors/sensors.h"
40 #include "sensors/acceleration.h"
42 #include "io/beeper.h"
46 #include "flight/pid.h"
48 #include "config/config.h"
49 #include "fc/controlrate_profile.h"
50 #include "fc/rc_modes.h"
51 #include "fc/rc_adjustments.h"
53 #include "fc/rc_controls.h"
54 #include "fc/runtime_config.h"
57 #include "scheduler/scheduler.h"
60 #include "unittest_macros.h"
61 #include "gtest/gtest.h"
63 void unsetArmingDisabled(armingDisableFlags_e flag
) {
67 class RcControlsModesTest
: public ::testing::Test
{
69 virtual void SetUp() {
73 TEST_F(RcControlsModesTest
, updateActivatedModesWithAllInputsAtMidde
)
77 memset(&mask
, 0, sizeof(mask
));
81 memset(&rxRuntimeState
, 0, sizeof(rxRuntimeState_t
));
82 rxRuntimeState
.channelCount
= MAX_SUPPORTED_RC_CHANNEL_COUNT
- NON_AUX_CHANNEL_COUNT
;
85 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
86 rcData
[index
] = PWM_RANGE_MIDDLE
;
90 analyzeModeActivationConditions();
91 updateActivatedModes();
94 for (int index
= 0; index
< CHECKBOX_ITEM_COUNT
; index
++) {
95 #ifdef DEBUG_RC_CONTROLS
96 printf("iteration: %d\n", index
);
98 EXPECT_FALSE(IS_RC_MODE_ACTIVE((boxId_e
)index
));
102 TEST_F(RcControlsModesTest
, updateActivatedModesUsingValidAuxConfigurationAndRXValues
)
105 modeActivationConditionsMutable(0)->modeId
= (boxId_e
)0;
106 modeActivationConditionsMutable(0)->auxChannelIndex
= AUX1
- NON_AUX_CHANNEL_COUNT
;
107 modeActivationConditionsMutable(0)->range
.startStep
= CHANNEL_VALUE_TO_STEP(1700);
108 modeActivationConditionsMutable(0)->range
.endStep
= CHANNEL_VALUE_TO_STEP(2100);
110 modeActivationConditionsMutable(1)->modeId
= (boxId_e
)1;
111 modeActivationConditionsMutable(1)->auxChannelIndex
= AUX2
- NON_AUX_CHANNEL_COUNT
;
112 modeActivationConditionsMutable(1)->range
.startStep
= CHANNEL_VALUE_TO_STEP(1300);
113 modeActivationConditionsMutable(1)->range
.endStep
= CHANNEL_VALUE_TO_STEP(1700);
115 modeActivationConditionsMutable(2)->modeId
= (boxId_e
)2;
116 modeActivationConditionsMutable(2)->auxChannelIndex
= AUX3
- NON_AUX_CHANNEL_COUNT
;
117 modeActivationConditionsMutable(2)->range
.startStep
= CHANNEL_VALUE_TO_STEP(900);
118 modeActivationConditionsMutable(2)->range
.endStep
= CHANNEL_VALUE_TO_STEP(1200);
120 modeActivationConditionsMutable(3)->modeId
= (boxId_e
)3;
121 modeActivationConditionsMutable(3)->auxChannelIndex
= AUX4
- NON_AUX_CHANNEL_COUNT
;
122 modeActivationConditionsMutable(3)->range
.startStep
= CHANNEL_VALUE_TO_STEP(900);
123 modeActivationConditionsMutable(3)->range
.endStep
= CHANNEL_VALUE_TO_STEP(2100);
125 modeActivationConditionsMutable(4)->modeId
= (boxId_e
)4;
126 modeActivationConditionsMutable(4)->auxChannelIndex
= AUX5
- NON_AUX_CHANNEL_COUNT
;
127 modeActivationConditionsMutable(4)->range
.startStep
= CHANNEL_VALUE_TO_STEP(900);
128 modeActivationConditionsMutable(4)->range
.endStep
= CHANNEL_VALUE_TO_STEP(925);
130 EXPECT_EQ(0, modeActivationConditions(4)->range
.startStep
);
131 EXPECT_EQ(1, modeActivationConditions(4)->range
.endStep
);
133 modeActivationConditionsMutable(5)->modeId
= (boxId_e
)5;
134 modeActivationConditionsMutable(5)->auxChannelIndex
= AUX6
- NON_AUX_CHANNEL_COUNT
;
135 modeActivationConditionsMutable(5)->range
.startStep
= CHANNEL_VALUE_TO_STEP(2075);
136 modeActivationConditionsMutable(5)->range
.endStep
= CHANNEL_VALUE_TO_STEP(2100);
138 EXPECT_EQ(47, modeActivationConditions(5)->range
.startStep
);
139 EXPECT_EQ(48, modeActivationConditions(5)->range
.endStep
);
141 modeActivationConditionsMutable(6)->modeId
= (boxId_e
)6;
142 modeActivationConditionsMutable(6)->auxChannelIndex
= AUX7
- NON_AUX_CHANNEL_COUNT
;
143 modeActivationConditionsMutable(6)->range
.startStep
= CHANNEL_VALUE_TO_STEP(925);
144 modeActivationConditionsMutable(6)->range
.endStep
= CHANNEL_VALUE_TO_STEP(950);
146 EXPECT_EQ(1, modeActivationConditions(6)->range
.startStep
);
147 EXPECT_EQ(2, modeActivationConditions(6)->range
.endStep
);
151 memset(&mask
, 0, sizeof(mask
));
155 memset(&rxRuntimeState
, 0, sizeof(rxRuntimeState_t
));
156 rxRuntimeState
.channelCount
= MAX_SUPPORTED_RC_CHANNEL_COUNT
- NON_AUX_CHANNEL_COUNT
;
159 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
160 rcData
[index
] = PWM_RANGE_MIDDLE
;
163 rcData
[AUX1
] = PWM_RANGE_MAX
;
164 rcData
[AUX2
] = PWM_RANGE_MIDDLE
;
165 rcData
[AUX3
] = PWM_RANGE_MIN
;
166 rcData
[AUX4
] = PWM_RANGE_MAX
;
167 rcData
[AUX5
] = 899; // value lower that range minimum should be treated the same as the lowest range value
168 rcData
[AUX6
] = 2101; // value higher than the range maximum should be treated the same as the highest range value
169 rcData
[AUX7
] = 950; // value equal to range step upper boundary should not activate the mode
172 boxBitmask_t activeBoxIds
;
173 memset(&activeBoxIds
, 0, sizeof(boxBitmask_t
));
174 bitArraySet(&activeBoxIds
, 0);
175 bitArraySet(&activeBoxIds
, 1);
176 bitArraySet(&activeBoxIds
, 2);
177 bitArraySet(&activeBoxIds
, 3);
178 bitArraySet(&activeBoxIds
, 4);
179 bitArraySet(&activeBoxIds
, 5);
182 analyzeModeActivationConditions();
183 updateActivatedModes();
186 for (int index
= 0; index
< CHECKBOX_ITEM_COUNT
; index
++) {
187 #ifdef DEBUG_RC_CONTROLS
188 printf("iteration: %d, %d\n", index
, (bool)(bitArrayGet(&activeBoxIds
, index
)));
190 EXPECT_EQ((bool)(bitArrayGet(&activeBoxIds
, index
)), IS_RC_MODE_ACTIVE((boxId_e
)index
));
195 COUNTER_QUEUE_CONFIRMATION_BEEP
,
196 COUNTER_CHANGE_CONTROL_RATE_PROFILE
198 #define CALL_COUNT_ITEM_COUNT 2
200 static int callCounts
[CALL_COUNT_ITEM_COUNT
];
202 #define CALL_COUNTER(item) (callCounts[item])
205 void beeperConfirmationBeeps(uint8_t) {
206 callCounts
[COUNTER_QUEUE_CONFIRMATION_BEEP
]++;
209 void beeper(beeperMode_e mode
) {
213 void changeControlRateProfile(uint8_t) {
214 callCounts
[COUNTER_CHANGE_CONTROL_RATE_PROFILE
]++;
219 void resetCallCounters(void) {
220 memset(&callCounts
, 0, sizeof(callCounts
));
223 uint32_t fixedMillis
;
226 uint32_t millis(void) {
230 uint32_t micros(void) {
231 return fixedMillis
* 1000;
235 void resetMillis(void) {
239 #define DEFAULT_MIN_CHECK 1100
240 #define DEFAULT_MAX_CHECK 1900
243 PG_REGISTER(rxConfig_t
, rxConfig
, PG_RX_CONFIG
, 0);
245 extern int stepwiseAdjustmentCount
;
246 extern timedAdjustmentState_t stepwiseAdjustments
[MAX_ADJUSTMENT_RANGE_COUNT
];
248 extern int continuosAdjustmentCount
;
249 extern continuosAdjustmentState_t continuosAdjustments
[MAX_ADJUSTMENT_RANGE_COUNT
];
252 class RcControlsAdjustmentsTest
: public ::testing::Test
{
254 controlRateConfig_t controlRateConfig
= {
255 .rcRates
[FD_ROLL
] = 90,
256 .rcRates
[FD_PITCH
] = 90,
257 .rcExpo
[FD_ROLL
] = 0,
258 .rcExpo
[FD_PITCH
] = 0,
267 channelRange_t fullRange
= {
268 .startStep
= MIN_MODE_RANGE_STEP
,
269 .endStep
= MAX_MODE_RANGE_STEP
272 int adjustmentRangesIndex
;
274 virtual void SetUp() {
276 rxConfigMutable()->mincheck
= DEFAULT_MIN_CHECK
;
277 rxConfigMutable()->maxcheck
= DEFAULT_MAX_CHECK
;
278 rxConfigMutable()->midrc
= 1500;
280 controlRateConfig
.rcRates
[FD_ROLL
] = 90;
281 controlRateConfig
.rcRates
[FD_PITCH
] = 90;
282 controlRateConfig
.rcExpo
[FD_ROLL
] = 0;
283 controlRateConfig
.rcExpo
[FD_PITCH
] = 0;
284 controlRateConfig
.thrMid8
= 0;
285 controlRateConfig
.thrExpo8
= 0;
286 controlRateConfig
.rcExpo
[FD_YAW
] = 0;
287 controlRateConfig
.rates
[0] = 0;
288 controlRateConfig
.rates
[1] = 0;
289 controlRateConfig
.rates
[2] = 0;
290 controlRateConfig
.tpa_rate
= 0;
291 controlRateConfig
.tpa_breakpoint
= 0;
293 PG_RESET(adjustmentRanges
);
294 adjustmentRangesIndex
= 0;
296 stepwiseAdjustmentCount
= 0;
297 continuosAdjustmentCount
= 0;
300 int configureAdjustmentRange(uint8_t switchChannelIndex
, uint8_t adjustmentConfigIndex
) {
301 adjustmentRange_t
*adjustmentRange
= adjustmentRangesMutable(adjustmentRangesIndex
);
302 adjustmentRange
->auxChannelIndex
= AUX1
- NON_AUX_CHANNEL_COUNT
;
303 adjustmentRange
->range
= fullRange
;
305 adjustmentRange
->adjustmentConfig
= adjustmentConfigIndex
;
306 adjustmentRange
->auxSwitchChannelIndex
= switchChannelIndex
;
308 return adjustmentRangesIndex
++;
311 timedAdjustmentState_t
*configureStepwiseAdjustment(uint8_t switchChannelIndex
, uint8_t adjustmentConfigIndex
) {
312 int adjustmentRangeIndex
= configureAdjustmentRange(switchChannelIndex
, adjustmentConfigIndex
);
314 timedAdjustmentState_t
*adjustmentState
= &stepwiseAdjustments
[stepwiseAdjustmentCount
++];
315 adjustmentState
->adjustmentRangeIndex
= adjustmentRangeIndex
;
316 adjustmentState
->timeoutAt
= 0;
317 adjustmentState
->ready
= true;
319 return adjustmentState
;
322 void configureContinuosAdjustment(uint8_t switchChannelIndex
, uint8_t adjustmentConfigIndex
) {
323 int adjustmentRangeIndex
= configureAdjustmentRange(switchChannelIndex
, adjustmentConfigIndex
);
325 continuosAdjustmentState_t
*adjustmentState
= &continuosAdjustments
[continuosAdjustmentCount
++];
326 adjustmentState
->adjustmentRangeIndex
= adjustmentRangeIndex
;
327 adjustmentState
->lastRcData
= 0;
331 #define ADJUSTMENT_CONFIG_RATE_INDEX 1
333 TEST_F(RcControlsAdjustmentsTest
, processRcAdjustmentsSticksInMiddle
)
336 const timedAdjustmentState_t
*adjustmentState
= configureStepwiseAdjustment(AUX3
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_CONFIG_RATE_INDEX
);
339 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
340 rcData
[index
] = PWM_RANGE_MIDDLE
;
348 processRcAdjustments(&controlRateConfig
);
351 EXPECT_EQ(90, controlRateConfig
.rcRates
[FD_ROLL
]);
352 EXPECT_EQ(90, controlRateConfig
.rcRates
[FD_PITCH
]);
353 EXPECT_EQ(0, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
354 EXPECT_TRUE(adjustmentState
->ready
);
357 TEST_F(RcControlsAdjustmentsTest
, processRcAdjustmentsWithRcRateFunctionSwitchUp
)
360 controlRateConfig_t controlRateConfig
= {
361 .rcRates
[FD_ROLL
] = 90,
362 .rcRates
[FD_PITCH
] = 90,
363 .rcExpo
[FD_ROLL
] = 0,
364 .rcExpo
[FD_PITCH
] = 0,
375 rxConfigMutable()->mincheck
= DEFAULT_MIN_CHECK
;
376 rxConfigMutable()->maxcheck
= DEFAULT_MAX_CHECK
;
377 rxConfigMutable()->midrc
= 1500;
380 const timedAdjustmentState_t
*adjustmentState
= configureStepwiseAdjustment(AUX3
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_CONFIG_RATE_INDEX
);
383 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
384 rcData
[index
] = PWM_RANGE_MIDDLE
;
392 rcData
[AUX3
] = PWM_RANGE_MAX
;
398 processRcAdjustments(&controlRateConfig
);
401 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_ROLL
]);
402 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_PITCH
]);
403 EXPECT_EQ(1, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
404 EXPECT_FALSE(adjustmentState
->ready
);
407 // now pretend a short amount of time has passed, but not enough time to allow the value to have been increased
414 processRcAdjustments(&controlRateConfig
);
416 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_ROLL
]);
417 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_PITCH
]);
418 EXPECT_FALSE(adjustmentState
->ready
);
422 // moving the switch back to the middle should immediately reset the state flag without increasing the value
427 rcData
[AUX3
] = PWM_RANGE_MIDDLE
;
433 processRcAdjustments(&controlRateConfig
);
435 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_ROLL
]);
436 EXPECT_EQ(91, controlRateConfig
.rcRates
[FD_PITCH
]);
437 EXPECT_TRUE(adjustmentState
->ready
);
441 // flipping the switch again, before the state reset would have occurred, allows the value to be increased again
444 rcData
[AUX3
] = PWM_RANGE_MAX
;
450 processRcAdjustments(&controlRateConfig
);
453 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_ROLL
]);
454 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_PITCH
]);
455 EXPECT_EQ(2, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
456 EXPECT_FALSE(adjustmentState
->ready
);
459 // leaving the switch up, after the original timer would have reset the state should now NOT cause
460 // the rate to increase, it should only increase after another 500ms from when the state was reset.
467 processRcAdjustments(&controlRateConfig
);
470 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_ROLL
]);
471 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_PITCH
]);
472 EXPECT_FALSE(adjustmentState
->ready
);
475 // should still not be able to be increased
482 processRcAdjustments(&controlRateConfig
);
485 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_ROLL
]);
486 EXPECT_EQ(92, controlRateConfig
.rcRates
[FD_PITCH
]);
487 EXPECT_FALSE(adjustmentState
->ready
);
490 // 500ms has now passed since the switch was returned to the middle, now that
491 // switch is still in the UP position after the timer has elapses it should
492 // be increased again.
499 processRcAdjustments(&controlRateConfig
);
502 EXPECT_EQ(93, controlRateConfig
.rcRates
[FD_ROLL
]);
503 EXPECT_EQ(93, controlRateConfig
.rcRates
[FD_PITCH
]);
504 EXPECT_EQ(3, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
505 EXPECT_FALSE(adjustmentState
->ready
);
508 #define ADJUSTMENT_RATE_PROFILE_INDEX 12
510 TEST_F(RcControlsAdjustmentsTest
, processRcRateProfileAdjustments
)
513 configureContinuosAdjustment(AUX4
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_RATE_PROFILE_INDEX
);
516 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
517 rcData
[index
] = PWM_RANGE_MIDDLE
;
525 rcData
[AUX4
] = PWM_RANGE_MAX
;
528 processRcAdjustments(&controlRateConfig
);
531 EXPECT_EQ(1, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
532 EXPECT_EQ(1, CALL_COUNTER(COUNTER_CHANGE_CONTROL_RATE_PROFILE
));
535 #define ADJUSTMENT_PITCH_ROLL_P_INDEX 6
536 #define ADJUSTMENT_PITCH_ROLL_I_INDEX 7
537 #define ADJUSTMENT_PITCH_ROLL_D_INDEX 8
538 #define ADJUSTMENT_YAW_P_INDEX 9
539 #define ADJUSTMENT_YAW_I_INDEX 10
540 #define ADJUSTMENT_YAW_D_INDEX 11
542 TEST_F(RcControlsAdjustmentsTest
, processPIDIncreasePidController0
)
545 pidProfile_t pidProfile
;
546 memset(&pidProfile
, 0, sizeof(pidProfile
));
547 pidProfile
.pid
[PID_PITCH
].P
= 0;
548 pidProfile
.pid
[PID_PITCH
].I
= 10;
549 pidProfile
.pid
[PID_PITCH
].D
= 20;
550 pidProfile
.pid
[PID_ROLL
].P
= 5;
551 pidProfile
.pid
[PID_ROLL
].I
= 15;
552 pidProfile
.pid
[PID_ROLL
].D
= 25;
553 pidProfile
.pid
[PID_YAW
].P
= 7;
554 pidProfile
.pid
[PID_YAW
].I
= 17;
555 pidProfile
.pid
[PID_YAW
].D
= 27;
557 controlRateConfig_t controlRateConfig
;
558 memset(&controlRateConfig
, 0, sizeof(controlRateConfig
));
560 const timedAdjustmentState_t
*adjustmentState1
= configureStepwiseAdjustment(AUX1
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_PITCH_ROLL_P_INDEX
);
561 const timedAdjustmentState_t
*adjustmentState2
= configureStepwiseAdjustment(AUX2
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_PITCH_ROLL_I_INDEX
);
562 const timedAdjustmentState_t
*adjustmentState3
= configureStepwiseAdjustment(AUX3
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_PITCH_ROLL_D_INDEX
);
563 const timedAdjustmentState_t
*adjustmentState4
= configureStepwiseAdjustment(AUX1
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_YAW_P_INDEX
);
564 const timedAdjustmentState_t
*adjustmentState5
= configureStepwiseAdjustment(AUX2
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_YAW_I_INDEX
);
565 const timedAdjustmentState_t
*adjustmentState6
= configureStepwiseAdjustment(AUX3
- NON_AUX_CHANNEL_COUNT
, ADJUSTMENT_YAW_D_INDEX
);
568 for (int index
= AUX1
; index
< MAX_SUPPORTED_RC_CHANNEL_COUNT
; index
++) {
569 rcData
[index
] = PWM_RANGE_MIDDLE
;
577 rcData
[AUX1
] = PWM_RANGE_MAX
;
578 rcData
[AUX2
] = PWM_RANGE_MAX
;
579 rcData
[AUX3
] = PWM_RANGE_MAX
;
582 currentPidProfile
= &pidProfile
;
584 processRcAdjustments(&controlRateConfig
);
587 EXPECT_EQ(6, CALL_COUNTER(COUNTER_QUEUE_CONFIRMATION_BEEP
));
588 EXPECT_FALSE(adjustmentState1
->ready
);
589 EXPECT_FALSE(adjustmentState2
->ready
);
590 EXPECT_FALSE(adjustmentState3
->ready
);
591 EXPECT_FALSE(adjustmentState4
->ready
);
592 EXPECT_FALSE(adjustmentState5
->ready
);
593 EXPECT_FALSE(adjustmentState6
->ready
);
596 EXPECT_EQ(1, pidProfile
.pid
[PID_PITCH
].P
);
597 EXPECT_EQ(11, pidProfile
.pid
[PID_PITCH
].I
);
598 EXPECT_EQ(21, pidProfile
.pid
[PID_PITCH
].D
);
599 EXPECT_EQ(6, pidProfile
.pid
[PID_ROLL
].P
);
600 EXPECT_EQ(16, pidProfile
.pid
[PID_ROLL
].I
);
601 EXPECT_EQ(26, pidProfile
.pid
[PID_ROLL
].D
);
602 EXPECT_EQ(8, pidProfile
.pid
[PID_YAW
].P
);
603 EXPECT_EQ(18, pidProfile
.pid
[PID_YAW
].I
);
604 EXPECT_EQ(28, pidProfile
.pid
[PID_YAW
].D
);
608 void setConfigDirty(void) {}
609 void saveConfigAndNotify(void) {}
610 void initRcProcessing(void) {}
611 void changePidProfile(uint8_t) {}
612 void pidInitConfig(const pidProfile_t
*) {}
613 void accStartCalibration(void) {}
614 void gyroStartCalibration(bool isFirstArmingCalibration
)
616 UNUSED(isFirstArmingCalibration
);
618 void applyAccelerometerTrimsDelta(rollAndPitchTrims_t
*) {}
619 void handleInflightCalibrationStickPosition(void) {}
620 bool featureIsEnabled(uint32_t) { return false;}
621 bool sensors(uint32_t) { return false;}
623 void disarm(flightLogDisarmReason_e
) {}
624 void dashboardDisablePageCycling() {}
625 void dashboardEnablePageCycling() {}
627 bool failsafeIsActive() { return false; }
628 bool rxIsReceivingSignal() { return true; }
630 uint8_t getCurrentControlRateProfileIndex(void) {
633 void GPS_reset_home_position(void) {}
634 void baroSetGroundLevel(void) {}
636 void blackboxLogEvent(FlightLogEvent
, flightLogEventData_t
*) {}
638 bool cmsInMenu
= false;
639 uint8_t armingFlags
= 0;
640 uint16_t flightModeFlags
= 0;
642 uint8_t stateFlags
= 0;
643 float rcData
[MAX_SUPPORTED_RC_CHANNEL_COUNT
];
644 pidProfile_t
*currentPidProfile
;
645 rxRuntimeState_t rxRuntimeState
;
646 PG_REGISTER(blackboxConfig_t
, blackboxConfig
, PG_BLACKBOX_CONFIG
, 0);
647 PG_REGISTER(systemConfig_t
, systemConfig
, PG_SYSTEM_CONFIG
, 2);
648 void resetArmingDisabled(void) {}
649 timeDelta_t
getTaskDeltaTimeUs(taskId_e
) { return 20000; }
650 armingDisableFlags_e
getArmingDisableFlags(void) {
651 return (armingDisableFlags_e
) 0;
653 bool isTryingToArm(void) { return false; }
654 void resetTryingToArm(void) {}
655 void setLedProfile(uint8_t profile
) { UNUSED(profile
); }
656 uint8_t getLedProfile(void) { return 0; }
657 void compassStartCalibration(void) {}
658 void pinioBoxTaskControl(void) {}
659 void schedulerIgnoreTaskExecTime(void) {}