From 51188d1392ca1b04e58f17b64048d72d36975636 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Tue, 19 Sep 2023 11:11:31 +0800 Subject: [PATCH] Make sure sw_enablement doesn't overwrite register Signed-off-by: Daniel Schaefer --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7143e09..01d6fdb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,7 +127,7 @@ where /// How many SW rows to enable pub fn sw_enablement(&mut self, setting: SwSetting) -> Result<(), I2cError> { - let config_register = 1; // Shutdown disable + let config_register = self.read_register(Page::Config, addresses::CONFIG_REGISTER)?; let new_val = (config_register & 0x0F) | (setting as u8) << 4; self.write_register(Page::Config, addresses::CONFIG_REGISTER, new_val)?;