Skip to content

Commit 5901e60

Browse files
committed
Moved to != for constant literals
1 parent c69cbf4 commit 5901e60

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_mcp2515/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,11 @@
189189
666000: (0x00, 0xA0, 0x04),
190190
},
191191

192-
# Values based on this calculator, for 8MHz, controller MCP2510: https://www.kvaser.com/support/calculators/bit-timing-calculator/
192+
# Values based on this calculator, for 8MHz, controller MCP2510:
193+
# https://www.kvaser.com/support/calculators/bit-timing-calculator/
193194
8000000: {
194195
# CNF1, CNF2, CNF3
195-
1000000: (0x00, 0x91, 0x01), # seems it is not possible, so use the previous value of 500000
196+
1000000: (0x00, 0x91, 0x01), # seems it is not possible, this values may be wrong
196197
500000: (0x00, 0x91, 0x01),
197198
250000: (0x40, 0xb5, 0x01),
198199
200000: (0x00, 0xb6, 0x04),
@@ -632,7 +633,7 @@ def _get_tx_buffer(self):
632633

633634
def _set_baud_rate(self):
634635
# ******* set baud rate ***********
635-
if self._xtal_frequency is not 16000000 and self._xtal_frequency is not 8000000:
636+
if self._xtal_frequency != 16000000 and self._xtal_frequency != 8000000:
636637
raise RuntimeError("Incorrect xtal frequency")
637638

638639
cnf1, cnf2, cnf3 = _BAUD_RATES[self._xtal_frequency][self.baudrate]

0 commit comments

Comments
 (0)