From 5b124d59f2213720288561b38441d0fc7d41b57f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 24 Jul 2018 15:45:51 -0400 Subject: [PATCH] spi_temperature: Remove spi_mode parameter All of the Maxim chips can use SPI mode 1, so no need to configure it. Signed-off-by: Kevin O'Connor --- config/example-extras.cfg | 3 --- klippy/extras/spi_temperature.py | 6 ++---- test/klippy/temperature.cfg | 4 ---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/config/example-extras.cfg b/config/example-extras.cfg index 285006e4..be2dc5d7 100644 --- a/config/example-extras.cfg +++ b/config/example-extras.cfg @@ -639,9 +639,6 @@ # heater parameters. The parameters below describe sensor parameters. #sensor_type: # One of "MAX6675", "MAX31855", "MAX31856", or "MAX31865". -#spi_mode: -# The SPI mode to use when communicating with the chip. This -# parameter must be provided. #spi_speed: # The SPI speed (in hz) to use when communicating with the chip. # This parameter must be provided. diff --git a/klippy/extras/spi_temperature.py b/klippy/extras/spi_temperature.py index f7c15fda..b5dd23e9 100644 --- a/klippy/extras/spi_temperature.py +++ b/klippy/extras/spi_temperature.py @@ -32,12 +32,10 @@ class SensorBase: pin = pin_params['pin'] # SPI bus configuration spi_oid = mcu.create_oid() - spi_mode = config.getint('spi_mode', minval=0, maxval=3) spi_speed = config.getint('spi_speed', minval=0) mcu.add_config_cmd( - "config_spi oid=%u bus=%u pin=%s" - " mode=%u rate=%u shutdown_msg=" % ( - spi_oid, 0, pin, spi_mode, spi_speed)) + "config_spi oid=%u bus=0 pin=%s mode=1 rate=%u shutdown_msg=" % ( + spi_oid, pin, spi_speed)) if config_cmd is not None: config_cmd = "".join("%02x" % b for b in config_cmd) mcu.add_config_cmd("spi_send oid=%u data=%s" % ( diff --git a/test/klippy/temperature.cfg b/test/klippy/temperature.cfg index a7742b23..3e82de30 100644 --- a/test/klippy/temperature.cfg +++ b/test/klippy/temperature.cfg @@ -59,7 +59,6 @@ min_temp: 0 max_temp: 100 control: watermark sensor_type: MAX6675 -spi_mode: 0 spi_speed: 100000 sensor_pin: ar2 @@ -69,7 +68,6 @@ min_temp: 0 max_temp: 100 control: watermark sensor_type: MAX31855 -spi_mode: 0 spi_speed: 100000 sensor_pin: ar5 @@ -79,7 +77,6 @@ min_temp: 0 max_temp: 100 control: watermark sensor_type: MAX31856 -spi_mode: 0 spi_speed: 100000 sensor_pin: ar7 @@ -89,7 +86,6 @@ min_temp: 0 max_temp: 100 control: watermark sensor_type: MAX31865 -spi_mode: 0 spi_speed: 100000 sensor_pin: ar13