aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/display/uc1701.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-12-27 19:11:46 -0500
committerKevinOConnor <kevin@koconnor.net>2019-01-07 20:00:44 -0500
commite26d1a356708b3702c91a86ff37f3c5c615941c9 (patch)
tree89cbc00e3af6fe731c863da4a30b487b56a8badd /klippy/extras/display/uc1701.py
parentf2f54290e84903679bdb9548924f933a6efe311d (diff)
downloadkutter-e26d1a356708b3702c91a86ff37f3c5c615941c9.tar.gz
kutter-e26d1a356708b3702c91a86ff37f3c5c615941c9.tar.xz
kutter-e26d1a356708b3702c91a86ff37f3c5c615941c9.zip
i2ccmds: Pass the i2c address as a 7-bit number (0-127)
The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/display/uc1701.py')
-rw-r--r--klippy/extras/display/uc1701.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/display/uc1701.py b/klippy/extras/display/uc1701.py
index 86366b4f..4f98896b 100644
--- a/klippy/extras/display/uc1701.py
+++ b/klippy/extras/display/uc1701.py
@@ -177,11 +177,11 @@ class UC1701(DisplayBase):
logging.info("uc1701 initialized")
# The SSD1306 supports both i2c and "4-wire" spi
-class SSD1306(UC1701):
+class SSD1306(DisplayBase):
def __init__(self, config):
cs_pin = config.get("cs_pin", None)
if cs_pin is None:
- io = I2C(config, 120)
+ io = I2C(config, 60)
else:
io = SPI4wire(config, "dc_pin")
DisplayBase.__init__(self, io)