mirror of https://github.com/arendst/Tasmota.git
Set default IR receive tolerance (25%) if set to zero
This commit is contained in:
parent
29723d5e9b
commit
f9b0947d67
|
@ -198,6 +198,7 @@ void IrReceiveUpdateThreshold(void)
|
||||||
void IrReceiveUpdateTolerance(void)
|
void IrReceiveUpdateTolerance(void)
|
||||||
{
|
{
|
||||||
if (irrecv != nullptr) {
|
if (irrecv != nullptr) {
|
||||||
|
if (Settings->param[P_IR_TOLERANCE] == 0) { Settings->param[P_IR_TOLERANCE] = IR_RCV_TOLERANCE; }
|
||||||
if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; }
|
if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; }
|
||||||
irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]);
|
irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,7 @@ void IrReceiveUpdateThreshold(void)
|
||||||
void IrReceiveUpdateTolerance(void)
|
void IrReceiveUpdateTolerance(void)
|
||||||
{
|
{
|
||||||
if (irrecv != nullptr) {
|
if (irrecv != nullptr) {
|
||||||
|
if (Settings->param[P_IR_TOLERANCE] == 0) { Settings->param[P_IR_TOLERANCE] = IR_RCV_TOLERANCE; }
|
||||||
if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; }
|
if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; }
|
||||||
irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]);
|
irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue