Skip to content

Commit 8ddddd2

Browse files
author
Richard Unger
committed
only print combination if there is one found
1 parent daaa0fb commit 8ddddd2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/drivers/hardware_specific/stm32_mcu.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@ int findBestTimerCombination(int numPins, int pins[], PinMap* pinTimers[]) {
396396
#endif
397397
return -10; // no workable combination found
398398
}
399-
#ifdef SIMPLEFOC_STM32_DEBUG
400-
SimpleFOCDebug::print("STM32: best: ");
401-
printTimerCombination(numPins, pinTimers, bestScore);
402-
#endif
399+
else if (bestScore >= 0) {
400+
#ifdef SIMPLEFOC_STM32_DEBUG
401+
SimpleFOCDebug::print("STM32: best: ");
402+
printTimerCombination(numPins, pinTimers, bestScore);
403+
#endif
404+
}
403405
return bestScore;
404406
};
405407

0 commit comments

Comments
 (0)