Merge pull request #15880 from curzon01/fix-flowmeter

Fix single sensor exception
This commit is contained in:
Theo Arends 2022-06-30 21:15:19 +02:00 committed by GitHub
commit fdebf32562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -104,8 +104,10 @@ void FlowRateMeterInit(void)
flowratemeter_valuesread = false;
for (uint32_t i = 0; i < MAX_FLOWRATEMETER; i++) {
pinMode(Pin(GPIO_FLOWRATEMETER_IN, i), INPUT);
attachInterrupt(Pin(GPIO_FLOWRATEMETER_IN, i), irq_service[i], RISING);
if (PinUsed(GPIO_FLOWRATEMETER_IN, i)) {
pinMode(Pin(GPIO_FLOWRATEMETER_IN, i), INPUT);
attachInterrupt(Pin(GPIO_FLOWRATEMETER_IN, i), irq_service[i], RISING);
}
}
}