mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Configuration validation.
This enables a new feature setting for PARALLEL_PWM which is enabled by default. This starts to move much of the feature checking/excluding code that is littered through into a single place - validateAndFixConfig(). Since the config is known to be valid after the method is called other code can just get on with it's job instead of checking for confliciting features/settings.
This commit is contained in:
parent
0fd127bf60
commit
5c4bfd4e58
13 changed files with 269 additions and 193 deletions
|
@ -157,8 +157,8 @@ void pwmInit(drv_pwm_config_t *init)
|
|||
#endif
|
||||
|
||||
#ifdef STM32F10X_MD
|
||||
// skip UART ports for GPS
|
||||
if (init->useUART && (timerIndex == PWM3 || timerIndex == PWM4))
|
||||
// skip UART2 ports
|
||||
if (init->useUART2 && (timerIndex == PWM3 || timerIndex == PWM4))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
|
@ -189,7 +189,10 @@ void pwmInit(drv_pwm_config_t *init)
|
|||
#endif
|
||||
|
||||
// hacks to allow current functionality
|
||||
if (mask & (TYPE_IP | TYPE_IW) && !init->enableInput)
|
||||
if (mask & TYPE_IW && !init->useParallelPWM)
|
||||
mask = 0;
|
||||
|
||||
if (mask & TYPE_IP && !init->usePPM)
|
||||
mask = 0;
|
||||
|
||||
if (init->useServos && !init->airplane) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue