Skip to content

Commit 0051af4

Browse files
author
Richard Unger
committed
stm32 driver: fix check for low-side channels
1 parent 0066b5e commit 0051af4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/drivers/hardware_specific/stm32_mcu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ int scoreCombination(int numPins, PinMap* pinTimers[]) {
337337
else {
338338

339339
// check for inverted low-side channels
340-
if (STM_PIN_INVERTED(pinTimers[0]->function) || STM_PIN_INVERTED(pinTimers[2]->function) || STM_PIN_INVERTED(pinTimers[4]->function))
340+
if (STM_PIN_INVERTED(pinTimers[1]->function) || STM_PIN_INVERTED(pinTimers[3]->function) || STM_PIN_INVERTED(pinTimers[5]->function))
341341
return -6; // bad combination - inverted channel used on low-side channel in software 6-pwm
342342
score += 10; // software 6pwm, score >10
343343
}
@@ -423,7 +423,7 @@ int findBestTimerCombination(int numPins, int pins[], PinMap* pinTimers[]) {
423423
return -10; // no workable combination found
424424
}
425425
#ifdef SIMPLEFOC_STM32_DEBUG
426-
SimpleFOCDebug::print("STM32: best score: ");
426+
SimpleFOCDebug::print("STM32: best: ");
427427
printTimerCombination(numPins, pinTimers, bestScore);
428428
#endif
429429
return bestScore;

0 commit comments

Comments
 (0)