diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-05-22 11:40:53 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-05-22 11:40:53 -0400 |
commit | 6268c702e5c390aaf0d4b26b4dc9eaaa705a9984 (patch) | |
tree | d625fc7100a112dd01ec8e0a277cbfd2f9fd026c | |
parent | bcfd1018674522a74c0865792d69db51376a7dd9 (diff) | |
download | kutter-6268c702e5c390aaf0d4b26b4dc9eaaa705a9984.tar.gz kutter-6268c702e5c390aaf0d4b26b4dc9eaaa705a9984.tar.xz kutter-6268c702e5c390aaf0d4b26b4dc9eaaa705a9984.zip |
spi_temperature: MAX6675 and MAX31855 should use spi mode 0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/extras/spi_temperature.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/klippy/extras/spi_temperature.py b/klippy/extras/spi_temperature.py index 07321a6d..65a080ff 100644 --- a/klippy/extras/spi_temperature.py +++ b/klippy/extras/spi_temperature.py @@ -15,14 +15,14 @@ import bus REPORT_TIME = 0.300 class SensorBase: - def __init__(self, config, chip_type, config_cmd=None): + def __init__(self, config, chip_type, config_cmd=None, spi_mode=1): self.printer = config.get_printer() self.chip_type = chip_type self._callback = None self.min_sample_value = self.max_sample_value = 0 self._report_clock = 0 self.spi = bus.MCU_SPI_from_config( - config, 1, pin_option="sensor_pin", default_speed=4000000) + config, spi_mode, pin_option="sensor_pin", default_speed=4000000) if config_cmd is not None: self.spi.spi_send(config_cmd) self.mcu = mcu = self.spi.get_mcu() @@ -192,7 +192,7 @@ MAX31855_MULT = 0.25 class MAX31855(SensorBase): def __init__(self, config): - SensorBase.__init__(self, config, "MAX31855") + SensorBase.__init__(self, config, "MAX31855", spi_mode=0) def calc_temp(self, adc, fault): if adc & 0x1: self.fault("MAX31855 : Open Circuit") @@ -221,7 +221,7 @@ MAX6675_MULT = 0.25 class MAX6675(SensorBase): def __init__(self, config): - SensorBase.__init__(self, config, "MAX6675") + SensorBase.__init__(self, config, "MAX6675", spi_mode=0) def calc_temp(self, adc, fault): if adc & 0x02: self.fault("Max6675 : Device ID error") |