We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53e0780 commit 7e3a596Copy full SHA for 7e3a596
lib/sht4x/comm.ex
@@ -43,7 +43,8 @@ defmodule SHT4X.Comm do
43
44
defp repeat_transaction(transport, command, delay_ms, retries) do
45
case do_transaction(transport, command, delay_ms) do
46
- {:error, _any_reason} when retries > 0 ->
+ # only retry in the event of a CRC mismatch
47
+ {:error, :crc_mismatch} when retries > 0 ->
48
repeat_transaction(transport, command, delay_ms, retries - 1)
49
50
result ->
0 commit comments