1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 13:25:30 +03:00

Motor output reordering for CLI and MSP

Fixed some code formatting

+fixReorderingArray() for EEPROM load/save and renamings

fix brace new line

moving MOTOR_OUTPUT_REORDERING to MSP2 betaflight specific

validateAndfixConfig now resets reordering motor array to default in case it is invalid
This commit is contained in:
limonspb 2020-06-23 18:46:11 -05:00
parent 1d78f97846
commit 464919c416
17 changed files with 185 additions and 21 deletions

View file

@ -650,8 +650,9 @@ motorDevice_t *dshotBitbangDevInit(const motorDevConfig_t *motorConfig, uint8_t
#endif
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < motorCount; motorIndex++) {
const timerHardware_t *timerHardware = timerGetByTag(motorConfig->ioTags[motorIndex]);
const IO_t io = IOGetByTag(motorConfig->ioTags[motorIndex]);
const unsigned reorderedMotorIndex = motorConfig->motorOutputReordering[motorIndex];
const timerHardware_t *timerHardware = timerGetByTag(motorConfig->ioTags[reorderedMotorIndex]);
const IO_t io = IOGetByTag(motorConfig->ioTags[reorderedMotorIndex]);
uint8_t output = motorConfig->motorPwmInversion ? timerHardware->output ^ TIMER_OUTPUT_INVERTED : timerHardware->output;
bbPuPdMode = (output & TIMER_OUTPUT_INVERTED) ? BB_GPIO_PULLDOWN : BB_GPIO_PULLUP;