mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Added motorConfig() macro
This commit is contained in:
parent
55b32740d9
commit
6ccf11d518
8 changed files with 45 additions and 43 deletions
|
@ -254,12 +254,12 @@ void init(void)
|
|||
servoMixerInit(masterConfig.customServoMixer);
|
||||
#endif
|
||||
|
||||
uint16_t idlePulse = masterConfig.motorConfig.mincommand;
|
||||
uint16_t idlePulse = motorConfig()->mincommand;
|
||||
if (feature(FEATURE_3D)) {
|
||||
idlePulse = masterConfig.flight3DConfig.neutral3d;
|
||||
}
|
||||
|
||||
if (masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_BRUSHED) {
|
||||
if (motorConfig()->motorPwmProtocol == PWM_TYPE_BRUSHED) {
|
||||
featureClear(FEATURE_3D);
|
||||
idlePulse = 0; // brushed motors
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ void init(void)
|
|||
|
||||
#if defined(USE_PWM) || defined(USE_PPM)
|
||||
if (feature(FEATURE_RX_PPM)) {
|
||||
ppmRxInit(&masterConfig.ppmConfig, masterConfig.motorConfig.motorPwmProtocol);
|
||||
ppmRxInit(&masterConfig.ppmConfig, motorConfig()->motorPwmProtocol);
|
||||
} else if (feature(FEATURE_RX_PARALLEL_PWM)) {
|
||||
pwmRxInit(&masterConfig.pwmConfig);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue