|
189 | 189 | 666000: (0x00, 0xA0, 0x04),
|
190 | 190 | },
|
191 | 191 |
|
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/ |
193 | 194 | 8000000: {
|
194 | 195 | # 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 |
196 | 197 | 500000: (0x00, 0x91, 0x01),
|
197 | 198 | 250000: (0x40, 0xb5, 0x01),
|
198 | 199 | 200000: (0x00, 0xb6, 0x04),
|
@@ -632,7 +633,7 @@ def _get_tx_buffer(self):
|
632 | 633 |
|
633 | 634 | def _set_baud_rate(self):
|
634 | 635 | # ******* 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: |
636 | 637 | raise RuntimeError("Incorrect xtal frequency")
|
637 | 638 |
|
638 | 639 | cnf1, cnf2, cnf3 = _BAUD_RATES[self._xtal_frequency][self.baudrate]
|
|
0 commit comments