Fixed tests.
This commit is contained in:
parent
db006b1585
commit
a10e1d05ed
|
@ -68,13 +68,18 @@ encoding_unittest_SRC := \
|
|||
|
||||
|
||||
flight_failsafe_unittest_SRC := \
|
||||
$(USER_DIR)/common/bitarray.c \
|
||||
$(USER_DIR)/fc/rc_modes.c \
|
||||
$(USER_DIR)/flight/failsafe.c
|
||||
|
||||
|
||||
flight_imu_unittest_SRC := \
|
||||
$(USER_DIR)/flight/imu.c \
|
||||
$(USER_DIR)/common/bitarray.c \
|
||||
$(USER_DIR)/common/maths.c \
|
||||
$(USER_DIR)/config/feature.c \
|
||||
$(USER_DIR)/fc/rc_modes.c \
|
||||
$(USER_DIR)/flight/altitude.c \
|
||||
$(USER_DIR)/common/maths.c
|
||||
$(USER_DIR)/flight/imu.c
|
||||
|
||||
|
||||
flight_mixer_unittest := \
|
||||
|
@ -93,6 +98,8 @@ io_serial_unittest_SRC := \
|
|||
|
||||
|
||||
ledstrip_unittest_SRC := \
|
||||
$(USER_DIR)/common/bitarray.c \
|
||||
$(USER_DIR)/fc/rc_modes.c \
|
||||
$(USER_DIR)/io/ledstrip.c
|
||||
|
||||
|
||||
|
@ -123,8 +130,10 @@ rx_ibus_unittest_SRC := \
|
|||
|
||||
|
||||
rx_ranges_unittest_SRC := \
|
||||
$(USER_DIR)/rx/rx.c \
|
||||
$(USER_DIR)/common/maths.c
|
||||
$(USER_DIR)/common/bitarray.c \
|
||||
$(USER_DIR)/common/maths.c \
|
||||
$(USER_DIR)/fc/rc_modes.c \
|
||||
$(USER_DIR)/rx/rx.c
|
||||
|
||||
|
||||
rx_rx_unittest_SRC := \
|
||||
|
|
|
@ -29,14 +29,19 @@ extern "C" {
|
|||
|
||||
#include "common/axis.h"
|
||||
#include "common/maths.h"
|
||||
#include "common/bitarray.h"
|
||||
|
||||
#include "fc/runtime_config.h"
|
||||
|
||||
#include "io/beeper.h"
|
||||
#include "fc/rc_modes.h"
|
||||
#include "fc/rc_controls.h"
|
||||
|
||||
#include "rx/rx.h"
|
||||
#include "flight/failsafe.h"
|
||||
|
||||
#include "io/beeper.h"
|
||||
|
||||
#include "rx/rx.h"
|
||||
|
||||
extern boxBitmask_t rcModeActivationMask;
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
@ -304,7 +309,10 @@ TEST(FlightFailsafeTest, TestFailsafeDetectsKillswitchEvent)
|
|||
// and
|
||||
throttleStatus = THROTTLE_HIGH; // throttle HIGH to go for a failsafe landing procedure
|
||||
failsafeConfigMutable()->failsafe_kill_switch = true; // configure AUX switch as kill switch
|
||||
ACTIVATE_RC_MODE(BOXFAILSAFE); // and activate it
|
||||
boxBitmask_t newMask;
|
||||
memset(&newMask, 0, sizeof(newMask));
|
||||
bitArraySet(&newMask, BOXFAILSAFE);
|
||||
rcModeUpdate(&newMask); // activate BOXFAILSAFE mode
|
||||
sysTickUptime = 0; // restart time from 0
|
||||
failsafeOnValidDataReceived(); // set last valid sample at current time
|
||||
sysTickUptime = PERIOD_RXDATA_FAILURE + 1; // adjust time to point just past the failure time to
|
||||
|
@ -324,7 +332,7 @@ TEST(FlightFailsafeTest, TestFailsafeDetectsKillswitchEvent)
|
|||
sysTickUptime += PERIOD_RXDATA_RECOVERY + 1; // adjust time to point just past the recovery time to
|
||||
failsafeOnValidDataReceived(); // cause a recovered link
|
||||
|
||||
rcModeActivationMask = DE_ACTIVATE_ALL_BOXES; // BOXFAILSAFE must be off (kill switch)
|
||||
memset(&rcModeActivationMask, 0, sizeof(rcModeActivationMask)); // BOXFAILSAFE must be off (kill switch)
|
||||
|
||||
// when
|
||||
failsafeUpdateState();
|
||||
|
@ -404,7 +412,6 @@ extern "C" {
|
|||
int16_t rcData[MAX_SUPPORTED_RC_CHANNEL_COUNT];
|
||||
uint8_t armingFlags;
|
||||
float rcCommand[4];
|
||||
uint32_t rcModeActivationMask;
|
||||
int16_t debug[DEBUG16_VALUE_COUNT];
|
||||
bool isUsingSticksToArm = true;
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ extern "C" {
|
|||
#include "common/axis.h"
|
||||
#include "common/maths.h"
|
||||
|
||||
#include "config/feature.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "drivers/accgyro/accgyro.h"
|
||||
|
@ -57,6 +58,12 @@ extern "C" {
|
|||
|
||||
PG_REGISTER(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 0);
|
||||
PG_REGISTER(barometerConfig_t, barometerConfig, PG_BAROMETER_CONFIG, 0);
|
||||
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(featureConfig_t, featureConfig, PG_FEATURE_CONFIG, 0);
|
||||
|
||||
PG_RESET_TEMPLATE(featureConfig_t, featureConfig,
|
||||
.enabledFeatures = 0
|
||||
);
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
|
|
@ -26,6 +26,7 @@ extern "C" {
|
|||
#include "common/maths.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
#include "fc/rc_controls.h"
|
||||
#include "fc/rc_modes.h"
|
||||
#include "rx/rx.h"
|
||||
}
|
||||
|
||||
|
@ -38,8 +39,6 @@ extern "C" {
|
|||
uint32_t rcModeActivationMask;
|
||||
|
||||
extern uint16_t applyRxChannelRangeConfiguraton(int sample, const rxChannelRangeConfig_t *range);
|
||||
|
||||
PG_REGISTER_ARRAY(modeActivationCondition_t, MAX_MODE_ACTIVATION_CONDITION_COUNT, modeActivationConditions, PG_MODE_ACTIVATION_PROFILE, 0);
|
||||
}
|
||||
|
||||
#define RANGE_CONFIGURATION(min, max) new (rxChannelRangeConfig_t) {min, max}
|
||||
|
|
Loading…
Reference in New Issue