Skip to content

Commit ce0a8f0

Browse files
committed
Eliminate one more local variable because pylint likes the number 15.
1 parent 1147027 commit ce0a8f0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

adafruit_rfm9x.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,15 @@ def __init__(self, spi, cs, reset, frequency, *, preamble_length=8,
417417
)
418418
# Optionally enable CRC checking on incoming packets.
419419
if enable_crc:
420-
config = self._read_u8(_RH_RF95_REG_1E_MODEM_CONFIG2) | 0x04
420+
self._write_u8(
421+
_RH_RF95_REG_1E_MODEM_CONFIG2,
422+
self._read_u8(_RH_RF95_REG_1E_MODEM_CONFIG2) | 0x04
423+
)
421424
else:
422-
config = self._read_u8(_RH_RF95_REG_1E_MODEM_CONFIG2) & 0xfb
423-
self._write_u8(_RH_RF95_REG_1E_MODEM_CONFIG2, config)
425+
self._write_u8(
426+
_RH_RF95_REG_1E_MODEM_CONFIG2,
427+
self._read_u8(_RH_RF95_REG_1E_MODEM_CONFIG2) & 0xfb
428+
)
424429
self.enable_crc = enable_crc
425430
# Note no sync word is set for LoRa mode either!
426431
self._write_u8(_RH_RF95_REG_26_MODEM_CONFIG3, 0x00) # Preamble lsb?

0 commit comments

Comments
 (0)