1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Removed dependency of pwm_output driver on mixers and servos

This commit is contained in:
Martin Budden 2017-02-17 13:42:33 +00:00
parent 367f62236a
commit 781b1b1352
22 changed files with 103 additions and 93 deletions

View file

@ -27,7 +27,7 @@ extern "C" {
#include "config/parameter_group.h"
#include "config/parameter_group_ids.h"
#include "io/motors.h"
#include "flight/mixer.h"
//PG_DECLARE(motorConfig_t, motorConfig);
@ -37,7 +37,7 @@ PG_RESET_TEMPLATE(motorConfig_t, motorConfig,
.minthrottle = 1150,
.maxthrottle = 1850,
.mincommand = 1000,
.motorPwmRate = 400,
.dev = {.motorPwmRate = 400}
);
}
@ -52,7 +52,7 @@ TEST(ParameterGroupsfTest, Test_pgResetAll)
EXPECT_EQ(1150, motorConfig()->minthrottle);
EXPECT_EQ(1850, motorConfig()->maxthrottle);
EXPECT_EQ(1000, motorConfig()->mincommand);
EXPECT_EQ(400, motorConfig()->motorPwmRate);
EXPECT_EQ(400, motorConfig()->dev.motorPwmRate);
}
TEST(ParameterGroupsfTest, Test_pgFind)
@ -63,16 +63,16 @@ TEST(ParameterGroupsfTest, Test_pgFind)
EXPECT_EQ(1150, motorConfig()->minthrottle);
EXPECT_EQ(1850, motorConfig()->maxthrottle);
EXPECT_EQ(1000, motorConfig()->mincommand);
EXPECT_EQ(400, motorConfig()->motorPwmRate);
EXPECT_EQ(400, motorConfig()->dev.motorPwmRate);
motorConfig_t motorConfig2;
memset(&motorConfig2, 0, sizeof(motorConfig_t));
motorConfigMutable()->motorPwmRate = 500;
motorConfigMutable()->dev.motorPwmRate = 500;
pgStore(pgRegistry, &motorConfig2, sizeof(motorConfig_t), 0);
EXPECT_EQ(1150, motorConfig2.minthrottle);
EXPECT_EQ(1850, motorConfig2.maxthrottle);
EXPECT_EQ(1000, motorConfig2.mincommand);
EXPECT_EQ(500, motorConfig2.motorPwmRate);
EXPECT_EQ(500, motorConfig2.dev.motorPwmRate);
motorConfig_t motorConfig3;
memset(&motorConfig3, 0, sizeof(motorConfig_t));
@ -80,7 +80,7 @@ TEST(ParameterGroupsfTest, Test_pgFind)
EXPECT_EQ(1150, motorConfig3.minthrottle);
EXPECT_EQ(1850, motorConfig3.maxthrottle);
EXPECT_EQ(1000, motorConfig3.mincommand);
EXPECT_EQ(400, motorConfig3.motorPwmRate);
EXPECT_EQ(400, motorConfig3.dev.motorPwmRate);
}
// STUBS