* Compare two (tick) values for Hash decoder * Use a tolerance of 20% to enable e.g. 500 and 600 (NEC timing) and at least 200 and 250 to be equal * @return 0 if newval is shorter, 1 if newval is equal, and 2 if newval is longer */
| 1134 | * @return 0 if newval is shorter, 1 if newval is equal, and 2 if newval is longer |
| 1135 | */ |
| 1136 | uint_fast8_t IRrecv::compare(uint16_t oldval, uint16_t newval) { |
| 1137 | if (newval * 10 < oldval * 8) { |
| 1138 | return 0; |
| 1139 | } |
| 1140 | if (oldval * 10 < newval * 8) { |
| 1141 | return 2; |
| 1142 | } |
| 1143 | return 1; |
| 1144 | } |
| 1145 | |
| 1146 | /** |
| 1147 | * Decodes an arbitrary IR code to a 32-bit value. |
nothing calls this directly
no outgoing calls
no test coverage detected