We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0051af4 commit 3b7b261Copy full SHA for 3b7b261
src/drivers/hardware_specific/stm32_mcu.cpp
@@ -307,15 +307,15 @@ int scoreCombination(int numPins, PinMap* pinTimers[]) {
307
return -4; // bad combination - duplicated channel
308
}
309
310
- int score = 1;
+ int score = 0;
311
for (int i=0; i<numPins; i++) {
312
// count distinct timers
313
- for (int j=1; j<i; j++) {
+ bool found = false;
314
+ for (int j=i+1; j<numPins; j++) {
315
if (pinTimers[i]->peripheral == pinTimers[j]->peripheral)
- break;
316
- if (i==j)
317
- score++;
+ found = true;
318
+ if (!found) score++;
319
320
if (numPins==6) {
321
// check for inverted channels - best: 1 timer, 3 channels, 3 matching inverted channels
0 commit comments