mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-10-26 00:36:08 +02:00
pca9533: do write on connect like pca9632 does
This is the only user of the i2c_write inside the init compatibility layer, so remove it as well. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
committed by
KevinOConnor
parent
6a8b823a45
commit
bb04546e6e
@@ -213,9 +213,6 @@ class MCU_I2C:
|
||||
"i2c_read_response oid=%c response=%*s", oid=self.oid,
|
||||
cq=self.cmd_queue)
|
||||
def i2c_write_noack(self, data, minclock=0, reqclock=0):
|
||||
if self.i2c_write_cmd is None:
|
||||
self._to_write.append(data)
|
||||
return
|
||||
self.i2c_write_cmd.send([self.oid, data],
|
||||
minclock=minclock, reqclock=reqclock)
|
||||
def i2c_write(self, data, minclock=0, reqclock=0):
|
||||
|
||||
@@ -14,9 +14,11 @@ PCA9533_PLS0=0b101
|
||||
|
||||
class PCA9533:
|
||||
def __init__(self, config):
|
||||
self.printer = config.get_printer()
|
||||
self.printer = printer = config.get_printer()
|
||||
self.i2c = bus.MCU_I2C_from_config(config, default_addr=98)
|
||||
self.led_helper = led.LEDHelper(config, self.update_leds, 1)
|
||||
printer.register_event_handler("klippy:connect", self.handle_connect)
|
||||
def handle_connect(self):
|
||||
self.i2c.i2c_write([PCA9533_PWM0, 85])
|
||||
self.i2c.i2c_write([PCA9533_PWM1, 170])
|
||||
self.update_leds(self.led_helper.get_status()['color_data'], None)
|
||||
|
||||
Reference in New Issue
Block a user