mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Reenabled RX ranges unit test
This commit is contained in:
parent
97be1698e7
commit
ed93775ee3
1 changed files with 50 additions and 12 deletions
58
src/test/unit/rx_ranges_unittest.cc.txt → src/test/unit/rx_ranges_unittest.cc
Executable file → Normal file
58
src/test/unit/rx_ranges_unittest.cc.txt → src/test/unit/rx_ranges_unittest.cc
Executable file → Normal file
|
@ -23,9 +23,10 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#include "rx/rx.h"
|
|
||||||
#include "io/rc_controls.h"
|
|
||||||
#include "common/maths.h"
|
#include "common/maths.h"
|
||||||
|
#include "config/parameter_group_ids.h"
|
||||||
|
#include "fc/rc_controls.h"
|
||||||
|
#include "rx/rx.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "unittest_macros.h"
|
#include "unittest_macros.h"
|
||||||
|
@ -36,10 +37,12 @@ extern "C" {
|
||||||
extern "C" {
|
extern "C" {
|
||||||
uint32_t rcModeActivationMask;
|
uint32_t rcModeActivationMask;
|
||||||
|
|
||||||
extern uint16_t applyRxChannelRangeConfiguraton(int sample, rxChannelRangeConfiguration_t range);
|
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) (rxChannelRangeConfiguration_t) {min, max}
|
#define RANGE_CONFIGURATION(min, max) new (rxChannelRangeConfig_t) {min, max}
|
||||||
|
|
||||||
TEST(RxChannelRangeTest, TestRxChannelRanges)
|
TEST(RxChannelRangeTest, TestRxChannelRanges)
|
||||||
{
|
{
|
||||||
|
@ -103,13 +106,13 @@ void failsafeOnRxResume(void) {}
|
||||||
uint32_t micros(void) { return 0; }
|
uint32_t micros(void) { return 0; }
|
||||||
uint32_t millis(void) { return 0; }
|
uint32_t millis(void) { return 0; }
|
||||||
|
|
||||||
void rxPwmInit(rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
void rxPwmInit(rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
UNUSED(callback);
|
UNUSED(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sbusInit(rxConfig_t *initialRxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
bool sbusInit(rxConfig_t *initialRxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(initialRxConfig);
|
UNUSED(initialRxConfig);
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
@ -117,7 +120,7 @@ bool sbusInit(rxConfig_t *initialRxConfig, rxRuntimeConfig_t *rxRuntimeConfig, r
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool spektrumInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
bool spektrumInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
@ -125,7 +128,7 @@ bool spektrumInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcRe
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sumdInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
bool sumdInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
@ -133,7 +136,7 @@ bool sumdInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRa
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sumhInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
bool sumhInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
@ -141,7 +144,39 @@ bool sumhInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRa
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rxMspInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataPtr *callback)
|
bool crsfRxInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
|
{
|
||||||
|
UNUSED(rxConfig);
|
||||||
|
UNUSED(rxRuntimeConfig);
|
||||||
|
UNUSED(callback);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool jetiExBusInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
|
{
|
||||||
|
UNUSED(rxConfig);
|
||||||
|
UNUSED(rxRuntimeConfig);
|
||||||
|
UNUSED(callback);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ibusInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
|
{
|
||||||
|
UNUSED(rxConfig);
|
||||||
|
UNUSED(rxRuntimeConfig);
|
||||||
|
UNUSED(callback);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool xBusInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
|
{
|
||||||
|
UNUSED(rxConfig);
|
||||||
|
UNUSED(rxRuntimeConfig);
|
||||||
|
UNUSED(callback);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rxMspInit(rxConfig_t *rxConfig, rxRuntimeConfig_t *rxRuntimeConfig, rcReadRawDataFnPtr *callback)
|
||||||
{
|
{
|
||||||
UNUSED(rxConfig);
|
UNUSED(rxConfig);
|
||||||
UNUSED(rxRuntimeConfig);
|
UNUSED(rxRuntimeConfig);
|
||||||
|
@ -153,6 +188,9 @@ bool feature(uint32_t) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void featureClear(uint32_t) {
|
||||||
|
}
|
||||||
|
|
||||||
bool rxMspFrameComplete(void)
|
bool rxMspFrameComplete(void)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
Loading…
Add table
Add a link
Reference in a new issue