mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
SPRacingF3 - Allow Sonar and Parallel PWM (drops 2 input channels).
Naze32 - Fix initialisation of outputs 5/6 when Parallel PWM and Sonar are used together with a mixer that needs more than 4 motors.
This commit is contained in:
parent
c0aec95e14
commit
b04be157b1
4 changed files with 29 additions and 6 deletions
|
@ -790,12 +790,6 @@ void validateAndFixConfig(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SPRACINGF3) && defined(SONAR)
|
|
||||||
if (feature(FEATURE_RX_PARALLEL_PWM) && feature(FEATURE_SONAR) ) {
|
|
||||||
featureClear(FEATURE_SONAR);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The retarded_arm setting is incompatible with pid_at_min_throttle because full roll causes the craft to roll over on the ground.
|
* The retarded_arm setting is incompatible with pid_at_min_throttle because full roll causes the craft to roll over on the ground.
|
||||||
* The pid_at_min_throttle implementation ignores yaw on the ground, but doesn't currently ignore roll when retarded_arm is enabled.
|
* The pid_at_min_throttle implementation ignores yaw on the ground, but doesn't currently ignore roll when retarded_arm is enabled.
|
||||||
|
|
|
@ -381,6 +381,29 @@ pwmOutputConfiguration_t *pwmInit(drv_pwm_config_t *init)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SONAR
|
||||||
|
// skip Sonar pins
|
||||||
|
// FIXME - Hack - See sonar.c sonarInit() and sonarHardware_t
|
||||||
|
if (init->useSonar && timerHardwarePtr->gpio == GPIOB) {
|
||||||
|
#if defined(SPRACINGF3) || defined(OLIMEXINO)
|
||||||
|
if (timerHardwarePtr->pin == GPIO_Pin_0 || timerHardwarePtr->pin == GPIO_Pin_1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if defined(NAZE)
|
||||||
|
if (init->useParallelPWM) {
|
||||||
|
if (timerHardwarePtr->pin == GPIO_Pin_8 || timerHardwarePtr->pin == GPIO_Pin_9) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (timerHardwarePtr->pin == GPIO_Pin_0 || timerHardwarePtr->pin == GPIO_Pin_1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SOFTSERIAL_1_TIMER
|
#ifdef SOFTSERIAL_1_TIMER
|
||||||
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL_1_TIMER)
|
if (init->useSoftSerial && timerHardwarePtr->tim == SOFTSERIAL_1_TIMER)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -52,6 +52,9 @@ typedef struct drv_pwm_config_t {
|
||||||
bool useOneshot;
|
bool useOneshot;
|
||||||
bool useSoftSerial;
|
bool useSoftSerial;
|
||||||
bool useLEDStrip;
|
bool useLEDStrip;
|
||||||
|
#ifdef SONAR
|
||||||
|
bool useSonar;
|
||||||
|
#endif
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
bool useServos;
|
bool useServos;
|
||||||
bool extraServos; // configure additional 4 channels in PPM mode as servos, not motors
|
bool extraServos; // configure additional 4 channels in PPM mode as servos, not motors
|
||||||
|
|
|
@ -213,6 +213,9 @@ void init(void)
|
||||||
pwm_params.useLEDStrip = feature(FEATURE_LED_STRIP);
|
pwm_params.useLEDStrip = feature(FEATURE_LED_STRIP);
|
||||||
pwm_params.usePPM = feature(FEATURE_RX_PPM);
|
pwm_params.usePPM = feature(FEATURE_RX_PPM);
|
||||||
pwm_params.useSerialRx = feature(FEATURE_RX_SERIAL);
|
pwm_params.useSerialRx = feature(FEATURE_RX_SERIAL);
|
||||||
|
#ifdef SONAR
|
||||||
|
pwm_params.useSonar = feature(FEATURE_SONAR);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_SERVOS
|
#ifdef USE_SERVOS
|
||||||
pwm_params.useServos = isMixerUsingServos();
|
pwm_params.useServos = isMixerUsingServos();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue