mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
USE_QUAD_MIXER_ONLY define removed from codebase
This commit is contained in:
parent
cd7a18fecd
commit
1d3c6c9195
8 changed files with 2 additions and 50 deletions
|
@ -19,13 +19,7 @@
|
||||||
|
|
||||||
#include "drivers/io_types.h"
|
#include "drivers/io_types.h"
|
||||||
|
|
||||||
#if defined(USE_QUAD_MIXER_ONLY)
|
#if defined(TARGET_MOTOR_COUNT)
|
||||||
#define MAX_PWM_MOTORS 4
|
|
||||||
#define MAX_PWM_SERVOS 1
|
|
||||||
#define MAX_MOTORS 4
|
|
||||||
#define MAX_SERVOS 1
|
|
||||||
|
|
||||||
#elif defined(TARGET_MOTOR_COUNT)
|
|
||||||
#define MAX_PWM_MOTORS TARGET_MOTOR_COUNT
|
#define MAX_PWM_MOTORS TARGET_MOTOR_COUNT
|
||||||
#define MAX_PWM_SERVOS 8
|
#define MAX_PWM_SERVOS 8
|
||||||
#define MAX_MOTORS TARGET_MOTOR_COUNT
|
#define MAX_MOTORS TARGET_MOTOR_COUNT
|
||||||
|
|
|
@ -142,7 +142,6 @@ static void cliBootlog(char *cmdline);
|
||||||
|
|
||||||
static const char* const emptyName = "-";
|
static const char* const emptyName = "-";
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
// sync this with mixerMode_e
|
// sync this with mixerMode_e
|
||||||
static const char * const mixerNames[] = {
|
static const char * const mixerNames[] = {
|
||||||
"TRI", "QUADP", "QUADX", "BI",
|
"TRI", "QUADP", "QUADX", "BI",
|
||||||
|
@ -152,7 +151,6 @@ static const char * const mixerNames[] = {
|
||||||
"HEX6H", "PPM_TO_SERVO", "DUALCOPTER", "SINGLECOPTER",
|
"HEX6H", "PPM_TO_SERVO", "DUALCOPTER", "SINGLECOPTER",
|
||||||
"ATAIL4", "CUSTOM", "CUSTOMAIRPLANE", "CUSTOMTRI", NULL
|
"ATAIL4", "CUSTOM", "CUSTOMAIRPLANE", "CUSTOMTRI", NULL
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
// sync this with features_e
|
// sync this with features_e
|
||||||
static const char * const featureNames[] = {
|
static const char * const featureNames[] = {
|
||||||
|
@ -964,7 +962,6 @@ static void cliAdjustmentRange(char *cmdline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
static void printMotorMix(uint8_t dumpMask, const motorMixer_t *customMotorMixer, const motorMixer_t *defaultCustomMotorMixer)
|
static void printMotorMix(uint8_t dumpMask, const motorMixer_t *customMotorMixer, const motorMixer_t *defaultCustomMotorMixer)
|
||||||
{
|
{
|
||||||
const char *format = "mmix %d %s %s %s %s";
|
const char *format = "mmix %d %s %s %s %s";
|
||||||
|
@ -1067,7 +1064,6 @@ static void cliMotorMix(char *cmdline)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // USE_QUAD_MIXER_ONLY
|
|
||||||
|
|
||||||
static void printRxRange(uint8_t dumpMask, const rxChannelRangeConfig_t *channelRangeConfigs, const rxChannelRangeConfig_t *defaultChannelRangeConfigs)
|
static void printRxRange(uint8_t dumpMask, const rxChannelRangeConfig_t *channelRangeConfigs, const rxChannelRangeConfig_t *defaultChannelRangeConfigs)
|
||||||
{
|
{
|
||||||
|
@ -2007,7 +2003,6 @@ static void cliGpsPassthrough(char *cmdline)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
static void cliMixer(char *cmdline)
|
static void cliMixer(char *cmdline)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
@ -2041,7 +2036,6 @@ static void cliMixer(char *cmdline)
|
||||||
|
|
||||||
cliMixer("");
|
cliMixer("");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void cliMotor(char *cmdline)
|
static void cliMotor(char *cmdline)
|
||||||
{
|
{
|
||||||
|
@ -2571,7 +2565,6 @@ static void printConfig(const char *cmdline, bool doDiff)
|
||||||
cliPrintHashLine("resources");
|
cliPrintHashLine("resources");
|
||||||
//printResource(dumpMask, &defaultConfig);
|
//printResource(dumpMask, &defaultConfig);
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
cliPrintHashLine("mixer");
|
cliPrintHashLine("mixer");
|
||||||
const bool equalsDefault = mixerConfig_Copy.mixerMode == mixerConfig()->mixerMode;
|
const bool equalsDefault = mixerConfig_Copy.mixerMode == mixerConfig()->mixerMode;
|
||||||
const char *formatMixer = "mixer %s";
|
const char *formatMixer = "mixer %s";
|
||||||
|
@ -2591,7 +2584,6 @@ static void printConfig(const char *cmdline, bool doDiff)
|
||||||
// print servo parameters
|
// print servo parameters
|
||||||
cliPrintHashLine("servo");
|
cliPrintHashLine("servo");
|
||||||
printServo(dumpMask, servoParams_CopyArray, servoParams(0));
|
printServo(dumpMask, servoParams_CopyArray, servoParams(0));
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cliPrintHashLine("feature");
|
cliPrintHashLine("feature");
|
||||||
|
@ -2743,12 +2735,10 @@ const clicmd_t cmdTable[] = {
|
||||||
CLI_COMMAND_DEF("led", "configure leds", NULL, cliLed),
|
CLI_COMMAND_DEF("led", "configure leds", NULL, cliLed),
|
||||||
#endif
|
#endif
|
||||||
CLI_COMMAND_DEF("map", "configure rc channel order", "[<map>]", cliMap),
|
CLI_COMMAND_DEF("map", "configure rc channel order", "[<map>]", cliMap),
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
CLI_COMMAND_DEF("mixer", "configure mixer",
|
CLI_COMMAND_DEF("mixer", "configure mixer",
|
||||||
"list\r\n"
|
"list\r\n"
|
||||||
"\t<name>", cliMixer),
|
"\t<name>", cliMixer),
|
||||||
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
|
CLI_COMMAND_DEF("mmix", "custom motor mixer", NULL, cliMotorMix),
|
||||||
#endif
|
|
||||||
CLI_COMMAND_DEF("motor", "get/set motor", "<index> [<value>]", cliMotor),
|
CLI_COMMAND_DEF("motor", "get/set motor", "<index> [<value>]", cliMotor),
|
||||||
CLI_COMMAND_DEF("name", "name of craft", NULL, cliName),
|
CLI_COMMAND_DEF("name", "name of craft", NULL, cliName),
|
||||||
#ifdef PLAY_SOUND
|
#ifdef PLAY_SOUND
|
||||||
|
|
|
@ -756,14 +756,12 @@ void taskMainPidLoop(timeUs_t currentTimeUs)
|
||||||
// motors do not spin up while we are trying to arm or disarm.
|
// motors do not spin up while we are trying to arm or disarm.
|
||||||
// Allow yaw control for tricopters if the user wants the servo to move even when unarmed.
|
// Allow yaw control for tricopters if the user wants the servo to move even when unarmed.
|
||||||
if (isUsingSticksForArming() && rcData[THROTTLE] <= rxConfig()->mincheck
|
if (isUsingSticksForArming() && rcData[THROTTLE] <= rxConfig()->mincheck
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
&& !((mixerConfig()->mixerMode == MIXER_TRI || mixerConfig()->mixerMode == MIXER_CUSTOM_TRI) && servoConfig()->tri_unarmed_servo)
|
&& !((mixerConfig()->mixerMode == MIXER_TRI || mixerConfig()->mixerMode == MIXER_CUSTOM_TRI) && servoConfig()->tri_unarmed_servo)
|
||||||
#endif
|
#endif
|
||||||
&& mixerConfig()->mixerMode != MIXER_AIRPLANE
|
&& mixerConfig()->mixerMode != MIXER_AIRPLANE
|
||||||
&& mixerConfig()->mixerMode != MIXER_FLYING_WING
|
&& mixerConfig()->mixerMode != MIXER_FLYING_WING
|
||||||
&& mixerConfig()->mixerMode != MIXER_CUSTOM_AIRPLANE
|
&& mixerConfig()->mixerMode != MIXER_CUSTOM_AIRPLANE
|
||||||
#endif
|
|
||||||
) {
|
) {
|
||||||
rcCommand[YAW] = 0;
|
rcCommand[YAW] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2175,7 +2175,6 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
case MSP_SET_MIXER:
|
case MSP_SET_MIXER:
|
||||||
if (dataSize >= 1) {
|
if (dataSize >= 1) {
|
||||||
mixerConfigMutable()->mixerMode = sbufReadU8(src);
|
mixerConfigMutable()->mixerMode = sbufReadU8(src);
|
||||||
|
@ -2183,7 +2182,6 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
} else
|
} else
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
case MSP_SET_RX_CONFIG:
|
case MSP_SET_RX_CONFIG:
|
||||||
if (dataSize >= 24) {
|
if (dataSize >= 24) {
|
||||||
|
@ -2244,12 +2242,8 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
|
|
||||||
case MSP_SET_BF_CONFIG:
|
case MSP_SET_BF_CONFIG:
|
||||||
if (dataSize >= 16) {
|
if (dataSize >= 16) {
|
||||||
#ifdef USE_QUAD_MIXER_ONLY
|
|
||||||
sbufReadU8(src); // mixerMode ignored
|
|
||||||
#else
|
|
||||||
mixerConfigMutable()->mixerMode = sbufReadU8(src); // mixerMode
|
mixerConfigMutable()->mixerMode = sbufReadU8(src); // mixerMode
|
||||||
mixerUpdateStateFlags(); // Required for correct preset functionality
|
mixerUpdateStateFlags(); // Required for correct preset functionality
|
||||||
#endif
|
|
||||||
|
|
||||||
featureClearAll();
|
featureClearAll();
|
||||||
featureSet(sbufReadU32(src)); // features bitmap
|
featureSet(sbufReadU32(src)); // features bitmap
|
||||||
|
|
|
@ -112,7 +112,6 @@ static const motorMixer_t mixerQuadX[] = {
|
||||||
#define DEF_MIXER(_mixerMode, _motorCount, _useServos, _motorMap) \
|
#define DEF_MIXER(_mixerMode, _motorCount, _useServos, _motorMap) \
|
||||||
{ .mixerMode=_mixerMode, .motorCount=_motorCount, .useServos=_useServos, .motor=_motorMap }
|
{ .mixerMode=_mixerMode, .motorCount=_motorCount, .useServos=_useServos, .motor=_motorMap }
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
static const motorMixer_t mixerTricopter[] = {
|
static const motorMixer_t mixerTricopter[] = {
|
||||||
{ 1.0f, 0.0f, 1.333333f, 0.0f }, // REAR
|
{ 1.0f, 0.0f, 1.333333f, 0.0f }, // REAR
|
||||||
{ 1.0f, -1.0f, -0.666667f, 0.0f }, // RIGHT
|
{ 1.0f, -1.0f, -0.666667f, 0.0f }, // RIGHT
|
||||||
|
@ -276,21 +275,13 @@ static const mixer_t mixerTable[] = {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
#else
|
|
||||||
static const mixer_t quadMixerDescriptor = DEF_MIXER( MIXER_QUADX, 4, false, mixerQuadX);
|
|
||||||
#endif // USE_QUAD_MIXER_ONLY
|
|
||||||
|
|
||||||
const mixer_t * findMixer(mixerMode_e mixerMode)
|
const mixer_t * findMixer(mixerMode_e mixerMode)
|
||||||
{
|
{
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
for (unsigned ii = 0; ii < sizeof(mixerTable)/sizeof(mixerTable[0]); ii++) {
|
for (unsigned ii = 0; ii < sizeof(mixerTable)/sizeof(mixerTable[0]); ii++) {
|
||||||
if (mixerTable[ii].mixerMode == mixerMode)
|
if (mixerTable[ii].mixerMode == mixerMode)
|
||||||
return &mixerTable[ii];
|
return &mixerTable[ii];
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (mixerMode == MIXER_QUADX)
|
|
||||||
return &quadMixerDescriptor;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -307,13 +298,8 @@ bool mixerIsOutputSaturated(void)
|
||||||
|
|
||||||
bool isMixerEnabled(mixerMode_e mixerMode)
|
bool isMixerEnabled(mixerMode_e mixerMode)
|
||||||
{
|
{
|
||||||
#ifdef USE_QUAD_MIXER_ONLY
|
|
||||||
UNUSED(mixerMode);
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
const mixer_t * mixer = findMixer(mixerMode);
|
const mixer_t * mixer = findMixer(mixerMode);
|
||||||
return (mixer != NULL) ? true : false;
|
return (mixer != NULL) ? true : false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
|
@ -388,8 +374,6 @@ void mixerUsePWMIOConfiguration(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
|
||||||
void mixerLoadMix(int index, motorMixer_t *customMixers)
|
void mixerLoadMix(int index, motorMixer_t *customMixers)
|
||||||
{
|
{
|
||||||
// we're 1-based
|
// we're 1-based
|
||||||
|
@ -408,8 +392,6 @@ void mixerLoadMix(int index, motorMixer_t *customMixers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void mixerResetDisarmedMotors(void)
|
void mixerResetDisarmedMotors(void)
|
||||||
{
|
{
|
||||||
// set disarmed motor values
|
// set disarmed motor values
|
||||||
|
|
|
@ -19,9 +19,7 @@
|
||||||
|
|
||||||
#include "config/parameter_group.h"
|
#include "config/parameter_group.h"
|
||||||
|
|
||||||
#if defined(USE_QUAD_MIXER_ONLY)
|
#if defined(TARGET_MOTOR_COUNT)
|
||||||
#define MAX_SUPPORTED_MOTORS 4
|
|
||||||
#elif defined(TARGET_MOTOR_COUNT)
|
|
||||||
#define MAX_SUPPORTED_MOTORS TARGET_MOTOR_COUNT
|
#define MAX_SUPPORTED_MOTORS TARGET_MOTOR_COUNT
|
||||||
#else
|
#else
|
||||||
#define MAX_SUPPORTED_MOTORS 12
|
#define MAX_SUPPORTED_MOTORS 12
|
||||||
|
|
|
@ -19,11 +19,7 @@
|
||||||
|
|
||||||
#include "config/parameter_group.h"
|
#include "config/parameter_group.h"
|
||||||
|
|
||||||
#if defined(USE_QUAD_MIXER_ONLY)
|
|
||||||
#define MAX_SUPPORTED_SERVOS 1
|
|
||||||
#else
|
|
||||||
#define MAX_SUPPORTED_SERVOS 8
|
#define MAX_SUPPORTED_SERVOS 8
|
||||||
#endif
|
|
||||||
|
|
||||||
// These must be consecutive, see 'reversedSources'
|
// These must be consecutive, see 'reversedSources'
|
||||||
enum {
|
enum {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue