Fix RFrecv exceptions 0 and/or 6 (#17285)

This commit is contained in:
Theo Arends 2022-12-09 17:35:57 +01:00
parent 1098ec2098
commit 423945233c
1 changed files with 12 additions and 12 deletions

View File

@ -758,7 +758,7 @@ bool RECEIVE_ATTR RCSwitch::receiveProtocol(const int p, unsigned int changeCoun
unsigned int sdelay = 0; unsigned int sdelay = 0;
if (syncLengthInPulses > 0) { if (syncLengthInPulses > 0) {
sdelay = RCSwitch::timings[FirstTiming] / syncLengthInPulses; sdelay = RCSwitch::timings[FirstTiming] / syncLengthInPulses;
} else { } else if (pro.PreambleFactor > 0) {
sdelay = RCSwitch::timings[FirstTiming-2] / pro.PreambleFactor; sdelay = RCSwitch::timings[FirstTiming-2] / pro.PreambleFactor;
} }
const unsigned int delay = sdelay; const unsigned int delay = sdelay;